summaryrefslogtreecommitdiff
path: root/extension/src/activation
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-08-19 01:00:24 -0700
committerNate Sesti <sestinj@gmail.com>2023-08-19 01:00:24 -0700
commit17806d932502adbf974ccd93a670e57b78be9a08 (patch)
tree233c6cc182a1b1a496db1b491b79de6c2be6e684 /extension/src/activation
parent70370bf0d033c2575c84ffe10c9e5c484bbad54f (diff)
downloadsncontinue-17806d932502adbf974ccd93a670e57b78be9a08.tar.gz
sncontinue-17806d932502adbf974ccd93a670e57b78be9a08.tar.bz2
sncontinue-17806d932502adbf974ccd93a670e57b78be9a08.zip
fix: :bug: make sure server_version.txt exists
Diffstat (limited to 'extension/src/activation')
-rw-r--r--extension/src/activation/environmentSetup.ts15
1 files changed, 10 insertions, 5 deletions
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts
index 36fa245f..fe0c8c0b 100644
--- a/extension/src/activation/environmentSetup.ts
+++ b/extension/src/activation/environmentSetup.ts
@@ -180,11 +180,16 @@ export async function startContinuePythonServer(redownload: boolean = true) {
let shouldDownload = true;
if (fs.existsSync(destination) && redownload) {
// Check if the server is the correct version
- const serverVersion = fs.readFileSync(serverVersionPath(), "utf8");
- if (serverVersion === getExtensionVersion()) {
- // The current version is already up and running, no need to continue
- console.log("Continue server already downloaded");
- shouldDownload = false;
+ if (fs.existsSync(serverVersionPath())) {
+ const serverVersion = fs.readFileSync(serverVersionPath(), "utf8");
+ if (serverVersion === getExtensionVersion()) {
+ // The current version is already up and running, no need to continue
+ console.log("Continue server already downloaded");
+ shouldDownload = false;
+ } else {
+ console.log("Old version of the server downloaded");
+ fs.unlinkSync(destination);
+ }
} else {
console.log("Old version of the server downloaded");
fs.unlinkSync(destination);