check for old version of Continue, notify
This commit is contained in:
parent
f775ed5678
commit
9846f4769f
2 changed files with 22 additions and 2 deletions
|
|
@ -7,9 +7,16 @@ import IdeProtocolClient from "../continueIdeClient";
|
|||
import { getContinueServerUrl } from "../bridge";
|
||||
import { CapturedTerminal } from "../terminal/terminalEmulator";
|
||||
import { setupDebugPanel, ContinueGUIWebviewViewProvider } from "../debugPanel";
|
||||
import { startContinuePythonServer } from "./environmentSetup";
|
||||
import {
|
||||
getExtensionVersion,
|
||||
startContinuePythonServer,
|
||||
} from "./environmentSetup";
|
||||
import fetch from "node-fetch";
|
||||
// import { CapturedTerminal } from "../terminal/terminalEmulator";
|
||||
|
||||
const PACKAGE_JSON_RAW_GITHUB_URL =
|
||||
"https://raw.githubusercontent.com/continuedev/continue/main/extension/package.json";
|
||||
|
||||
export let extensionContext: vscode.ExtensionContext | undefined = undefined;
|
||||
|
||||
export let ideProtocolClient: IdeProtocolClient;
|
||||
|
|
@ -20,6 +27,19 @@ export async function activateExtension(
|
|||
) {
|
||||
extensionContext = context;
|
||||
|
||||
// Before anything else, check whether this is an out-of-date version of the extension
|
||||
// Do so by grabbing the package.json off of the GitHub respository for now.
|
||||
fetch(PACKAGE_JSON_RAW_GITHUB_URL)
|
||||
.then(async (res) => res.json())
|
||||
.then((packageJson) => {
|
||||
if (packageJson.version !== getExtensionVersion()) {
|
||||
vscode.window.showInformationMessage(
|
||||
`You are using an out-of-date version of the Continue extension. Please update to the latest version.`
|
||||
);
|
||||
}
|
||||
})
|
||||
.catch((e) => console.log("Error checking for extension updates: ", e));
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
vscode.window.withProgress(
|
||||
{
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ function requirementsVersionPath(): string {
|
|||
return path.join(serverPath(), "requirements_version.txt");
|
||||
}
|
||||
|
||||
function getExtensionVersion() {
|
||||
export function getExtensionVersion() {
|
||||
const extension = vscode.extensions.getExtension("continue.continue");
|
||||
return extension?.packageJSON.version || "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue