fix: cleanup not available on development env
This commit is contained in:
parent
b7fc13efb7
commit
bc25b28a4e
2 changed files with 3 additions and 3 deletions
|
|
@ -9,7 +9,7 @@ export function createTemp(): Promise<[string, () => void]> {
|
|||
return new Promise<[string, () => void]>((res, rej) => {
|
||||
tmp.file((e, path, fd, cleanup) => {
|
||||
if (e) return rej(e);
|
||||
res([path, process.env.NODE_ENV === 'production' ? cleanup : () => {}]);
|
||||
res([path, process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'development' ? cleanup : () => {}]);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ export function createTempDir(): Promise<[string, () => void]> {
|
|||
},
|
||||
(e, path, cleanup) => {
|
||||
if (e) return rej(e);
|
||||
res([path, process.env.NODE_ENV === 'production' ? cleanup : () => {}]);
|
||||
res([path, process.env.NODE_ENV === 'production' || process.env.NODE_ENV === 'development' ? cleanup : () => {}]);
|
||||
},
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue