diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-08-14 18:08:55 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-08-14 18:08:55 -0700 |
commit | 1cef40aa74f3c5aa6f7df9d424ad6ae6e2937f8e (patch) | |
tree | 344badccb57a78daa565331de0665580a28c74ca /extension | |
parent | b07e2f299907989671c63bb5ee100bdc13f45eb5 (diff) | |
download | sncontinue-1cef40aa74f3c5aa6f7df9d424ad6ae6e2937f8e.tar.gz sncontinue-1cef40aa74f3c5aa6f7df9d424ad6ae6e2937f8e.tar.bz2 sncontinue-1cef40aa74f3c5aa6f7df9d424ad6ae6e2937f8e.zip |
remove hardcoded stuff
Diffstat (limited to 'extension')
-rw-r--r-- | extension/src/activation/environmentSetup.ts | 18 | ||||
-rw-r--r-- | extension/src/test-suite/environmentSetup.test.ts | 7 |
2 files changed, 9 insertions, 16 deletions
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 3cb702ac..36fa245f 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -204,7 +204,7 @@ export async function startContinuePythonServer(redownload: boolean = true) { ); console.log("Downloaded server executable at ", destination); } - + // Get name of the corresponding executable for platform if (os.platform() === "darwin") { // Add necessary permissions @@ -214,12 +214,14 @@ export async function startContinuePythonServer(redownload: boolean = true) { // Add necessary permissions fs.chmodSync(destination, 0o7_5_5); } - + // Validate that the file exists console.log("Looking for file at ", destination); if (!fs.existsSync(destination)) { // List the contents of the folder - const files = fs.readdirSync(path.join(getExtensionUri().fsPath, "server", "exe")); + const files = fs.readdirSync( + path.join(getExtensionUri().fsPath, "server", "exe") + ); console.log("Files in server folder: ", files); const errText = `- Failed to install Continue server.`; vscode.window.showErrorMessage(errText); @@ -236,9 +238,7 @@ export async function startContinuePythonServer(redownload: boolean = true) { const spawnChild = () => { const retry = (e: any) => { attempts++; - console.log( - `Error caught: ${e}.\n\nRetrying attempt ${attempts}...` - ); + console.log(`Error caught: ${e}.\n\nRetrying attempt ${attempts}...`); setTimeout(spawnChild, delay); }; try { @@ -251,14 +251,14 @@ export async function startContinuePythonServer(redownload: boolean = true) { detached: true, stdio: "ignore", }; - const settings: any = windowsSettings; - // os.platform() === "win32" ? windowsSettings : macLinuxSettings; + const settings: any = + os.platform() === "win32" ? windowsSettings : macLinuxSettings; // Spawn the server const child = spawn(destination, settings); // Either unref to avoid zombie process, or listen to events because you can - if (os.platform() === "win32" || true) { + if (os.platform() === "win32") { child.stdout.on("data", (data: any) => { console.log(`stdout: ${data}`); }); diff --git a/extension/src/test-suite/environmentSetup.test.ts b/extension/src/test-suite/environmentSetup.test.ts index 8ff64749..1c5fe97e 100644 --- a/extension/src/test-suite/environmentSetup.test.ts +++ b/extension/src/test-suite/environmentSetup.test.ts @@ -4,18 +4,11 @@ import * as assert from "assert"; import { getContinueServerUrl } from "../bridge"; import { startContinuePythonServer } from "../activation/environmentSetup"; import fetch from "node-fetch"; -import fkill from "fkill"; describe("Can start python server", () => { test("Can start python server in under 35 seconds", async function () { const allowedTime = 60_000; this.timeout(allowedTime + 10_000); - // try { - // fkill(65432, { force: true }); - // console.log("Killed existing server"); - // } catch (e) { - // console.log("No existing server: ", e); - // } console.log("Starting server in test..."); await startContinuePythonServer(false); |