Skip to content
Snippets Groups Projects
Unverified Commit 3a42fe50 authored by Johann150's avatar Johann150 Committed by GitHub
Browse files

fix: tmpdir cleanup removes contained files (#8826)

parent e4dc25dd
No related branches found
No related tags found
No related merge requests found
...@@ -11,9 +11,14 @@ export function createTemp(): Promise<[string, () => void]> { ...@@ -11,9 +11,14 @@ export function createTemp(): Promise<[string, () => void]> {
export function createTempDir(): Promise<[string, () => void]> { export function createTempDir(): Promise<[string, () => void]> {
return new Promise<[string, () => void]>((res, rej) => { return new Promise<[string, () => void]>((res, rej) => {
tmp.dir((e, path, cleanup) => { tmp.dir(
if (e) return rej(e); {
res([path, cleanup]); unsafeCleanup: true,
}); },
(e, path, cleanup) => {
if (e) return rej(e);
res([path, cleanup]);
}
);
}); });
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment