From 268312889a5229f9bfe8a1a85b644c588775333a Mon Sep 17 00:00:00 2001 From: oriash93 Date: Mon, 12 Mar 2018 00:42:20 +0200 Subject: [PATCH] Support for updating extensions from CLI --- src/vs/code/node/cliProcessMain.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/vs/code/node/cliProcessMain.ts b/src/vs/code/node/cliProcessMain.ts index af389ec5dc2..001eda9bb54 100644 --- a/src/vs/code/node/cliProcessMain.ts +++ b/src/vs/code/node/cliProcessMain.ts @@ -140,8 +140,18 @@ class Main { return TPromise.wrapError(new Error(`${notFound(id)}\n${useId}`)); } - console.log(localize('foundExtension', "Found '{0}' in the marketplace.", id)); - console.log(localize('installing', "Installing...")); + const installedExtension = installed.filter(e => getId(e.manifest) === id)[0]; + const installedVersion = installedExtension.manifest.version; + const newestVersion = extension.version; + const shouldUpdate = installedVersion !== newestVersion; + + if (shouldUpdate) { + console.log(localize('foundNewerVersion', "Installed version is '{0}', found newer version '{1}' in the marketplace.", installedVersion, newestVersion)); + console.log(localize('updating', "Updating...")); + } else { + console.log(localize('foundExtension', "Found '{0}' in the marketplace.", id)); + console.log(localize('installing', "Installing...")); + } return this.extensionManagementService.installFromGallery(extension) .then( -- GitLab