Do not bail when wiping the temp sketch has failed

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta 2021-02-01 13:05:27 +01:00 committed by Akos Kitta
parent 113fe38850
commit 911875665d

View File

@ -61,7 +61,9 @@ export class SaveAsSketch extends SketchContribution {
const workspaceUri = await this.sketchService.copy(sketch, { destinationUri });
if (workspaceUri && openAfterMove) {
if (wipeOriginal || (openAfterMove && execOnlyIfTemp)) {
await this.fileService.delete(new URI(sketch.uri), { recursive: true });
try {
await this.fileService.delete(new URI(sketch.uri), { recursive: true });
} catch { /* NOOP: from time to time, it's not possible to wipe the old resource from the temp dir on Windows */ }
}
this.workspaceService.open(new URI(workspaceUri), { preserveWindow: true });
}