diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-06-06 00:23:56 -0400 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-06-06 00:23:56 -0400 |
commit | 9f33cac01eef7cbe15dafb4bd51666195f120d69 (patch) | |
tree | 35a706455dac66b18c73a8688a417c6510df5e98 /extension | |
parent | 25aa481ef8b341e2216393da0768c9953bf25fec (diff) | |
download | sncontinue-9f33cac01eef7cbe15dafb4bd51666195f120d69.tar.gz sncontinue-9f33cac01eef7cbe15dafb4bd51666195f120d69.tar.bz2 sncontinue-9f33cac01eef7cbe15dafb4bd51666195f120d69.zip |
cleaning up with win32 check for powershell
Diffstat (limited to 'extension')
-rw-r--r-- | extension/src/activation/environmentSetup.ts | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 2410dcca..bc071461 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -5,7 +5,6 @@ const { spawn } = require("child_process"); import * as path from "path"; import * as fs from "fs"; import rebuild from "@electron/rebuild"; -import * as vscode from "vscode"; import { getContinueServerUrl } from "../bridge"; import fetch from "node-fetch"; @@ -14,7 +13,9 @@ async function runCommand(cmd: string): Promise<[string, string | undefined]> { var stdout: any = ""; var stderr: any = ""; try { - var { stdout, stderr } = await exec(cmd, {'shell':'powershell.exe'}); + var { stdout, stderr } = await exec(cmd, { + shell: process.platform === "win32" ? "powershell.exe" : undefined, + }); } catch (e: any) { stderr = e.stderr; stdout = e.stdout; @@ -70,7 +71,9 @@ function checkEnvExists() { ); return ( fs.existsSync(path.join(envBinPath, "activate")) && - fs.existsSync(path.join(envBinPath, process.platform == "win32" ? "pip.exe" : "pip")) + fs.existsSync( + path.join(envBinPath, process.platform == "win32" ? "pip.exe" : "pip") + ) ); } @@ -90,10 +93,6 @@ async function setupPythonEnv() { `${pythonCmd} -m venv env`, ].join("; "); - const [here, something] = await runCommand(`cd ${path.join(getExtensionUri().fsPath, "scripts")}`); - const [here1, something1] = await runCommand('cd c:\\Users\\Ty\\Documents\\continuedev\\continue\\extension\\scripts; python -m venv env'); - // console.log('cd c:\\Users\\Ty\\Documents\\continuedev\\continue\\extension\\scripts; c:\\Program` Files\\Python310\\python.exe -m venv env'); - // Repeat until it is successfully created (sometimes it fails to generate the bin, need to try again) while (true) { const [, stderr] = await runCommand(createEnvCommand); |