summaryrefslogtreecommitdiff
path: root/fs/empty_dir.ts
diff options
context:
space:
mode:
Diffstat (limited to 'fs/empty_dir.ts')
-rw-r--r--fs/empty_dir.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/fs/empty_dir.ts b/fs/empty_dir.ts
index 72f5f9f51..51be09971 100644
--- a/fs/empty_dir.ts
+++ b/fs/empty_dir.ts
@@ -16,8 +16,9 @@ export async function emptyDir(dir: string): Promise<void> {
}
while (items.length) {
const item = items.shift();
- if (item && item.path) {
- await Deno.remove(item.path, { recursive: true });
+ if (item && item.name) {
+ const fn = dir + "/" + item.name;
+ Deno.remove(fn, { recursive: true });
}
}
}
@@ -39,8 +40,9 @@ export function emptyDirSync(dir: string): void {
}
while (items.length) {
const item = items.shift();
- if (item && item.path) {
- Deno.removeSync(item.path, { recursive: true });
+ if (item && item.name) {
+ const fn = dir + "/" + item.name;
+ Deno.removeSync(fn, { recursive: true });
}
}
}