summaryrefslogtreecommitdiff
path: root/extension/src/activation/environmentSetup.ts
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-08-14 16:36:20 -0700
committerNate Sesti <sestinj@gmail.com>2023-08-14 16:36:20 -0700
commite1436e621b3c53765ad8807185d32c7d326bc507 (patch)
treeb5f8b0ce9cbd6651ec2541d384b955415bf6a0bd /extension/src/activation/environmentSetup.ts
parent6cc108a030a92aa3d2ec4ed33fb6f3405a1dec04 (diff)
downloadsncontinue-e1436e621b3c53765ad8807185d32c7d326bc507.tar.gz
sncontinue-e1436e621b3c53765ad8807185d32c7d326bc507.tar.bz2
sncontinue-e1436e621b3c53765ad8807185d32c7d326bc507.zip
don't chmod if not redownload
Diffstat (limited to 'extension/src/activation/environmentSetup.ts')
-rw-r--r--extension/src/activation/environmentSetup.ts21
1 files 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