From 7c4e973611af274c25acb38d0b8e674599ab8da7 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Tue, 21 May 2019 02:44:36 -0400 Subject: Bump v0.6.0 (denoland/deno_std#423) Original: https://github.com/denoland/deno_std/commit/47134db9f24de802bee560941584bbc32e75a9c3 --- fs/copy.ts | 4 ++-- fs/empty_dir.ts | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'fs') diff --git a/fs/copy.ts b/fs/copy.ts index 83c4e73ad..d02ca290f 100644 --- a/fs/copy.ts +++ b/fs/copy.ts @@ -145,7 +145,7 @@ async function copyDir( const files = await Deno.readDir(src); for (const file of files) { - const srcPath = file.path as string; + const srcPath = path.join(src, file.name); const destPath = path.join(dest, path.basename(srcPath as string)); if (file.isDirectory()) { await copyDir(srcPath, destPath, options); @@ -173,7 +173,7 @@ function copyDirSync(src: string, dest: string, options: CopyOptions): void { const files = Deno.readDirSync(src); for (const file of files) { - const srcPath = file.path as string; + const srcPath = path.join(src, file.name); const destPath = path.join(dest, path.basename(srcPath as string)); if (file.isDirectory()) { copyDirSync(srcPath, destPath, options); 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 { } 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 }); } } } -- cgit v1.2.3