summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--azure-pipelines.yml2
-rw-r--r--fs/copy.ts4
-rw-r--r--fs/empty_dir.ts10
-rwxr-xr-xhttp/file_server.ts7
4 files changed, 13 insertions, 10 deletions
diff --git a/azure-pipelines.yml b/azure-pipelines.yml
index 4044dd192..f7d086159 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 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<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 });
}
}
}
diff --git a/http/file_server.ts b/http/file_server.ts
index 6a3fb9e45..21482e747 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()