diff --git a/src/utils/UpdateNotifier.ts b/src/utils/UpdateNotifier.ts index 8357a9d..078b0b9 100644 --- a/src/utils/UpdateNotifier.ts +++ b/src/utils/UpdateNotifier.ts @@ -1,6 +1,6 @@ 'use strict'; -import { window } from 'vscode'; +import { window, commands } from 'vscode'; import { ExtensionManifestReader } from './ManifestUtils'; let req = require('request'); @@ -27,7 +27,12 @@ export function checkForUpdates() { let latestVersion = release.name.substring(1); // the telease/tag is prefixed with a "v" if (!release.draft && semver.gt(latestVersion, currentVersion)) { - window.showInformationMessage(`Version ${latestVersion} of the ${manifestReader.displayName} extension is available.`); + let updateNowLabel = 'Update Now'; + window.showInformationMessage(`Version ${latestVersion} of the ${manifestReader.displayName} extension is available.`, updateNowLabel).then((clicked) => { + if (clicked == updateNowLabel) { + commands.executeCommand('workbench.extensions.action.installExtension', manifestReader.displayName); + } + }); } } });