summaryrefslogtreecommitdiff
path: root/extension/src/activation/environmentSetup.ts
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-08-14 18:08:55 -0700
committerNate Sesti <sestinj@gmail.com>2023-08-14 18:08:55 -0700
commit1cef40aa74f3c5aa6f7df9d424ad6ae6e2937f8e (patch)
tree344badccb57a78daa565331de0665580a28c74ca /extension/src/activation/environmentSetup.ts
parentb07e2f299907989671c63bb5ee100bdc13f45eb5 (diff)
downloadsncontinue-1cef40aa74f3c5aa6f7df9d424ad6ae6e2937f8e.tar.gz
sncontinue-1cef40aa74f3c5aa6f7df9d424ad6ae6e2937f8e.tar.bz2
sncontinue-1cef40aa74f3c5aa6f7df9d424ad6ae6e2937f8e.zip
remove hardcoded stuff
Diffstat (limited to 'extension/src/activation/environmentSetup.ts')
-rw-r--r--extension/src/activation/environmentSetup.ts18
1 files changed, 9 insertions, 9 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}`);
});