diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-08-03 01:11:41 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-08-03 01:11:41 -0700 |
commit | bfd2f09cd6ebdc18e8162555a1859f0098b14cd3 (patch) | |
tree | 05b2bf8ac613b9af56c17e14179a87cceb80f8ea /extension | |
parent | 66b3a267c875f6d445032440de6a48982402f60e (diff) | |
download | sncontinue-bfd2f09cd6ebdc18e8162555a1859f0098b14cd3.tar.gz sncontinue-bfd2f09cd6ebdc18e8162555a1859f0098b14cd3.tar.bz2 sncontinue-bfd2f09cd6ebdc18e8162555a1859f0098b14cd3.zip |
small fixes to setup
Diffstat (limited to 'extension')
-rw-r--r-- | extension/src/activation/environmentSetup.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/extension/src/activation/environmentSetup.ts b/extension/src/activation/environmentSetup.ts index 8d9578e8..db457bd2 100644 --- a/extension/src/activation/environmentSetup.ts +++ b/extension/src/activation/environmentSetup.ts @@ -83,23 +83,23 @@ export function getExtensionVersion() { // Returns whether a server of the current version is already running async function checkOrKillRunningServer(serverUrl: string): Promise<boolean> { console.log("Checking if server is old version"); + const serverRunning = await checkServerRunning(serverUrl); // Kill the server if it is running an old version if (fs.existsSync(serverVersionPath())) { const serverVersion = fs.readFileSync(serverVersionPath(), "utf8"); - if ( - serverVersion === getExtensionVersion() && - (await checkServerRunning(serverUrl)) - ) { + if (serverVersion === getExtensionVersion() && serverRunning) { // The current version is already up and running, no need to continue return true; } } - console.log("Killing old server..."); - try { - await fkill(":65432"); - } catch (e: any) { - if (!e.message.includes("Process doesn't exist")) { - console.log("Failed to kill old server:", e); + if (serverRunning) { + console.log("Killing old server..."); + try { + await fkill(":65432"); + } catch (e: any) { + if (!e.message.includes("Process doesn't exist")) { + console.log("Failed to kill old server:", e); + } } } return false; |