Skip to content

Commit eb41ff6

Browse files
authored
Use rmdir
1 parent f2816c5 commit eb41ff6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/createTmpAsset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55
import * as tmp from 'tmp';
6-
import { rm } from 'fs-extra';
6+
import { rmdir } from 'fs-extra';
77
import { NestedError } from './nestedError';
88

99
export async function CreateTmpFile(): Promise<TmpAsset> {
@@ -43,7 +43,7 @@ export async function CreateTmpDir(unsafeCleanup: boolean): Promise<TmpAsset> {
4343
name: tmpDir.name,
4444
dispose: () => {
4545
if (unsafeCleanup) {
46-
rm(tmpDir.name).catch((rejectReason) => {
46+
rmdir(tmpDir.name).catch((rejectReason) => {
4747
throw new Error(`Failed to cleanup ${tmpDir.name} at ${tmpDir.fd}: ${rejectReason}`);
4848
}); //to delete directories that have folders inside them
4949
} else {

0 commit comments

Comments
 (0)