diff options
author | Ty Dunn <ty@tydunn.com> | 2023-06-26 21:42:14 -0700 |
---|---|---|
committer | Ty Dunn <ty@tydunn.com> | 2023-06-26 21:42:14 -0700 |
commit | 5c3dddc47a7e04015f3124310b0f815db0fc23f9 (patch) | |
tree | 83f315fb2fcae18e8989eeae15e73b07e0fc8fce /extension | |
parent | cf9d8c40f480be22c1cfd0493177b5a61adf8d0f (diff) | |
download | sncontinue-5c3dddc47a7e04015f3124310b0f815db0fc23f9.tar.gz sncontinue-5c3dddc47a7e04015f3124310b0f815db0fc23f9.tar.bz2 sncontinue-5c3dddc47a7e04015f3124310b0f815db0fc23f9.zip |
fixing on windows
Diffstat (limited to 'extension')
-rw-r--r-- | extension/src/activation/environmentSetup.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 25b6f643..6138dc64 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -71,14 +71,16 @@ async function getPythonPipCommands() { return [pythonCmd, pipCmd]; } -function getActivateUpgradeCommands(pythonCmd: string, pipCmd: string) { +function getActivateUpgradeTouchCommands(pythonCmd: string, pipCmd: string) { let activateCmd = ". env/bin/activate"; let pipUpgradeCmd = `${pipCmd} install --upgrade pip`; + let touchCmd = "touch .continue_env_installed"; if (process.platform == "win32") { activateCmd = ".\\env\\Scripts\\activate"; pipUpgradeCmd = `${pythonCmd} -m pip install --upgrade pip`; + touchCmd = "ni .continue_env_installed -type file"; } - return [activateCmd, pipUpgradeCmd]; + return [activateCmd, pipUpgradeCmd, touchCmd]; } function checkEnvExists() { @@ -106,7 +108,7 @@ async function setupPythonEnv() { console.log("Setting up python env for Continue extension..."); const [pythonCmd, pipCmd] = await getPythonPipCommands(); - const [activateCmd, pipUpgradeCmd] = getActivateUpgradeCommands( + const [activateCmd, pipUpgradeCmd, touchCmd] = getActivateUpgradeTouchCommands( pythonCmd, pipCmd ); @@ -153,7 +155,7 @@ async function setupPythonEnv() { activateCmd, pipUpgradeCmd, `${pipCmd} install -r requirements.txt`, - "touch .continue_env_installed", + touchCmd, ].join(" ; "); const [, stderr] = await runCommand(installRequirementsCommand); if (stderr) { @@ -230,7 +232,7 @@ export async function startContinuePythonServer() { let command = `cd ${path.join( getExtensionUri().fsPath, "scripts" - )} ; ${activateCmd} ; cd .. ; ${pythonCmd} -m scripts.run_continue_server`; + )} && ${activateCmd} && cd .. && ${pythonCmd} -m scripts.run_continue_server`; return await retryThenFail(async () => { console.log("Starting Continue python server..."); |