From e1436e621b3c53765ad8807185d32c7d326bc507 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 14 Aug 2023 16:36:20 -0700 Subject: don't chmod if not redownload --- extension/src/activation/environmentSetup.ts | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 1f088386..6c4a37a4 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -178,7 +178,7 @@ export async function startContinuePythonServer(redownload: boolean = true) { // First, check if the server is already downloaded let shouldDownload = true; - if (fs.existsSync(destination)) { + if (fs.existsSync(destination) && redownload) { // Check if the server is the correct version const serverVersion = fs.readFileSync(serverVersionPath(), "utf8"); if (serverVersion === getExtensionVersion()) { @@ -203,16 +203,15 @@ 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 - fs.chmodSync(destination, 0o7_5_5); - await runCommand(`xattr -dr com.apple.quarantine ${destination}`); - } else if (os.platform() === "linux") { - // Add necessary permissions - fs.chmodSync(destination, 0o7_5_5); + // Get name of the corresponding executable for platform + if (os.platform() === "darwin") { + // Add necessary permissions + fs.chmodSync(destination, 0o7_5_5); + await runCommand(`xattr -dr com.apple.quarantine ${destination}`); + } else if (os.platform() === "linux") { + // Add necessary permissions + fs.chmodSync(destination, 0o7_5_5); + } } // Validate that the file exists -- cgit v1.2.3-70-g09d2