Skip to content

Commit

Permalink
Bump v0.6.0 (#423)
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed May 21, 2019
1 parent dcad420 commit 47134db
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions fs/copy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
10 changes: 6 additions & 4 deletions fs/empty_dir.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
}
}
}
Expand All @@ -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 });
}
}
}
7 changes: 4 additions & 3 deletions http/file_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 47134db

Please sign in to comment.