diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4044dd1926..f7d0861593 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,5 +1,5 @@ variables: - DENO_VERSION: "v0.5.0" + DENO_VERSION: "v0.6.0" TS_VERSION: "3.4.5" # TODO DRY up the jobs diff --git a/fs/copy.ts b/fs/copy.ts index 83c4e73ad0..d02ca290f0 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 72f5f9f515..51be099715 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 }); } } } diff --git a/http/file_server.ts b/http/file_server.ts index 6a3fb9e459..21482e7470 100755 --- a/http/file_server.ts +++ b/http/file_server.ts @@ -149,19 +149,20 @@ async function serveDir( const listEntry: string[] = []; const fileInfos = await readDir(dirPath); for (const info of fileInfos) { + let fn = dirPath + "/" + info.name; if (info.name === "index.html" && info.isFile()) { // in case index.html as dir... - return await serveFile(req, info.path); + return await serveFile(req, fn); } // Yuck! let mode = null; try { - mode = (await stat(info.path)).mode; + mode = (await stat(fn)).mode; } catch (e) {} listEntry.push( createDirEntryDisplay( info.name, - dirName + "/" + info.name, + fn, info.isFile() ? info.len : null, mode, info.isDirectory()