cleanup only generated folders for removed extensions (#182028)

#181671 cleanup only generated folders for removed extensions
This commit is contained in:
Sandeep Somavarapu 2023-05-10 11:50:39 +02:00
parent 171b9acaab
commit 8669224a52
No known key found for this signature in database
GPG key ID: DD41CAAC8081CC7D

View file

@ -531,7 +531,7 @@ export class ExtensionsScanner extends Disposable {
async removeExtension(extension: ILocalExtension | IScannedExtension, type: string): Promise<void> {
this.logService.trace(`Deleting ${type} extension from disk`, extension.identifier.id, extension.location.fsPath);
const renamedLocation = this.uriIdentityService.extUri.joinPath(this.uriIdentityService.extUri.dirname(extension.location), `.${generateUuid()}`);
const renamedLocation = this.uriIdentityService.extUri.joinPath(this.uriIdentityService.extUri.dirname(extension.location), `._${generateUuid()}`);
await this.rename(extension.identifier, extension.location.fsPath, renamedLocation.fsPath, Date.now() + (2 * 60 * 1000) /* Retry for 2 minutes */);
await this.fileService.del(renamedLocation, { recursive: true });
this.logService.info('Deleted from disk', extension.identifier.id, extension.location.fsPath);
@ -706,7 +706,7 @@ export class ExtensionsScanner extends Disposable {
}
}
for (const child of stat?.children ?? []) {
if (child.isDirectory && child.name.startsWith('.') && isUUID(child.name.substring(1))) {
if (child.isDirectory && child.name.startsWith('._') && isUUID(child.name.substring(2))) {
promises.push((async () => {
this.logService.trace('Deleting the generated extension folder', child.resource.toString());
try {