Skip to content

Commit

Permalink
Fix #52946
Browse files Browse the repository at this point in the history
  • Loading branch information
sandy081 committed Jun 27, 2018
1 parent c00b163 commit 0a57108
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ export class ExtensionManagementService extends Disposable implements IExtension
private extractAndInstall({ zipPath, id, metadata }: InstallableExtension): TPromise<ILocalExtension> {
const tempPath = path.join(this.extensionsPath, `.${id}`);
const extensionPath = path.join(this.extensionsPath, id);
return this.extractAndRename(id, zipPath, tempPath, extensionPath)
return pfs.rimraf(extensionPath)
.then(() => this.extractAndRename(id, zipPath, tempPath, extensionPath), e => TPromise.wrapError(new ExtensionManagementError(nls.localize('errorDeleting', "Unable to delete the existing folder '{0}' while installing the extension '{1}'. Please delete the folder manually and try again", extensionPath, id), INSTALL_ERROR_DELETING)))
.then(() => {
this.logService.info('Installation completed.', id);
return this.scanExtension(id, this.extensionsPath, LocalExtensionType.User);
Expand Down

0 comments on commit 0a57108

Please sign in to comment.