diff options
author | Nate Sesti <sestinj@gmail.com> | 2023-07-27 10:12:03 -0700 |
---|---|---|
committer | Nate Sesti <sestinj@gmail.com> | 2023-07-27 10:12:03 -0700 |
commit | d66fb0f0144c35782d2f153495387102c12c7676 (patch) | |
tree | be3f5ecb71680960fa28c8779b5ff7269acbc5f3 /extension | |
parent | a572db40b6c9ce98b07e89d34f8652e19f91187e (diff) | |
download | sncontinue-d66fb0f0144c35782d2f153495387102c12c7676.tar.gz sncontinue-d66fb0f0144c35782d2f153495387102c12c7676.tar.bz2 sncontinue-d66fb0f0144c35782d2f153495387102c12c7676.zip |
refactor: :children_crossing: accept 1 version difference before notifying
Diffstat (limited to 'extension')
-rw-r--r-- | extension/src/activation/activate.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/extension/src/activation/activate.ts b/extension/src/activation/activate.ts index 356d0256..430f9f4a 100644 --- a/extension/src/activation/activate.ts +++ b/extension/src/activation/activate.ts @@ -15,6 +15,10 @@ export let extensionContext: vscode.ExtensionContext | undefined = undefined; export let ideProtocolClient: IdeProtocolClient; +function getExtensionVersionInt(versionString: string): number { + return parseInt(versionString.replace(/\./g, "")); +} + export async function activateExtension(context: vscode.ExtensionContext) { extensionContext = context; console.log("Using Continue version: ", getExtensionVersion()); @@ -23,7 +27,10 @@ export async function activateExtension(context: vscode.ExtensionContext) { fetch(PACKAGE_JSON_RAW_GITHUB_URL) .then(async (res) => res.json()) .then((packageJson) => { - if (packageJson.version !== getExtensionVersion()) { + const n1 = getExtensionVersionInt(packageJson.version); + const n2 = getExtensionVersionInt(getExtensionVersion()); + if (Math.abs(n1 - n2) > 1) { + // Accept up to 1 version difference vscode.window.showInformationMessage( `You are using an out-of-date version of the Continue extension. Please update to the latest version.` ); |