mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 04:17:37 +00:00
do not delete extensions not installed by VS Code (#161781)
This commit is contained in:
parent
01c22d9977
commit
91b9c4cf32
1 changed files with 2 additions and 2 deletions
|
@ -96,7 +96,7 @@ class ProfileExtensionsCleaner extends Disposable {
|
|||
|
||||
private async uninstallExtensionsNotInProfiles(): Promise<void> {
|
||||
const installed = await this.extensionManagementService.getAllUserInstalled();
|
||||
const toUninstall = installed.filter(installedExtension => !this.profileExtensionsLocations.has(this.getKey(installedExtension.identifier, installedExtension.manifest.version)));
|
||||
const toUninstall = installed.filter(installedExtension => installedExtension.installedTimestamp /* Installed by VS Code */ && !this.profileExtensionsLocations.has(this.getKey(installedExtension.identifier, installedExtension.manifest.version)));
|
||||
if (toUninstall.length) {
|
||||
await Promise.all(toUninstall.map(extension => this.extensionManagementService.uninstall(extension, uninstalOptions)));
|
||||
}
|
||||
|
@ -169,7 +169,7 @@ class ProfileExtensionsCleaner extends Disposable {
|
|||
|
||||
private async uninstallExtensions(extensionsToRemove: { identifier: IExtensionIdentifier; version: string }[]): Promise<void> {
|
||||
const installed = await this.extensionManagementService.getAllUserInstalled();
|
||||
const toUninstall = installed.filter(installedExtension => extensionsToRemove.some(e => this.getKey(installedExtension.identifier, installedExtension.manifest.version) === this.getKey(e.identifier, e.version)));
|
||||
const toUninstall = installed.filter(installedExtension => installedExtension.installedTimestamp /* Installed by VS Code */ && extensionsToRemove.some(e => this.getKey(installedExtension.identifier, installedExtension.manifest.version) === this.getKey(e.identifier, e.version)));
|
||||
if (toUninstall.length) {
|
||||
await Promise.all(toUninstall.map(extension => this.extensionManagementService.uninstall(extension, uninstalOptions)));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue