Function
deleteTempDirs
(context: IExtensionContext)
Source from the content-addressed store, hash-verified
| 36 | } |
| 37 | |
| 38 | export async function deleteTempDirs(context: IExtensionContext) { |
| 39 | try { |
| 40 | const dirs = await workspace.fs.readDirectory(context.globalStorageUri); |
| 41 | await Promise.all( |
| 42 | dirs |
| 43 | .filter(([name, type]) => name.startsWith(TEMP_DIR_PREFIX) && type === FileType.Directory) |
| 44 | .map(([dir]) => workspace.fs.delete(Uri.joinPath(context.globalStorageUri, dir), { recursive: true })) |
| 45 | ).catch(noop); |
| 46 | } catch { |
| 47 | // |
| 48 | } |
| 49 | } |
Tested by
no test coverage detected