mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 19:03:09 +02:00
fix: tmpdir cleanup removes contained files (#8826)
This commit is contained in:
parent
e4dc25dd5c
commit
3a42fe50c6
1 changed files with 9 additions and 4 deletions
|
@ -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]);
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue