提交 876062c5 编写于 作者: O oriash93

Handle all cases

上级 1912fcae
...@@ -134,6 +134,8 @@ class Main { ...@@ -134,6 +134,8 @@ class Main {
return TPromise.wrapError(new Error(`${notFound(id)}\n${useId}`)); return TPromise.wrapError(new Error(`${notFound(id)}\n${useId}`));
} }
const isInstalled = installed.some(e => getId(e.manifest) === id);
if (isInstalled) {
const installedExtension = installed.filter(e => getId(e.manifest) === id)[0]; const installedExtension = installed.filter(e => getId(e.manifest) === id)[0];
const installedVersion = installedExtension.manifest.version; const installedVersion = installedExtension.manifest.version;
const newestVersion = extension.version; const newestVersion = extension.version;
...@@ -143,6 +145,12 @@ class Main { ...@@ -143,6 +145,12 @@ class Main {
console.log(localize('foundNewerVersion', "Installed version is '{0}', found newer version '{1}' in the marketplace.", installedVersion, newestVersion)); console.log(localize('foundNewerVersion', "Installed version is '{0}', found newer version '{1}' in the marketplace.", installedVersion, newestVersion));
console.log(localize('updating', "Updating...")); console.log(localize('updating', "Updating..."));
} else { } else {
console.log(localize('alreadyUpdated', "Installed version is the latest version."));
return TPromise.as(null);
}
}
else {
console.log(localize('foundExtension', "Found '{0}' in the marketplace.", id)); console.log(localize('foundExtension', "Found '{0}' in the marketplace.", id));
console.log(localize('installing', "Installing...")); console.log(localize('installing', "Installing..."));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册