0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-30 09:08:00 -04:00

fs: Remove completed todo item (denoland/deno_std#406)

Original: d097e319e8
This commit is contained in:
Axetroy 2019-05-15 03:11:57 +08:00 committed by Ryan Dahl
parent 9c852cdfd2
commit a3de8c3d8a

View file

@ -4,8 +4,6 @@ import { ensureDir, ensureDirSync } from "./ensure_dir.ts";
import { exists, existsSync } from "./exists.ts"; import { exists, existsSync } from "./exists.ts";
import { getFileInfoType } from "./utils.ts"; import { getFileInfoType } from "./utils.ts";
const isWindows = Deno.platform.os === "win";
/** /**
* Ensures that the link exists. * Ensures that the link exists.
* If the directory structure does not exist, it is created. * If the directory structure does not exist, it is created.
@ -30,12 +28,7 @@ export async function ensureSymlink(src: string, dest: string): Promise<void> {
await ensureDir(path.dirname(dest)); await ensureDir(path.dirname(dest));
// TODO(axetroy): remove this if condition. refs: https://github.com/denoland/deno/issues/2169 await Deno.symlink(src, dest, srcFilePathType);
if (isWindows) {
await Deno.symlink(src, dest, srcFilePathType || undefined);
} else {
await Deno.symlink(src, dest);
}
} }
/** /**
@ -62,10 +55,5 @@ export function ensureSymlinkSync(src: string, dest: string): void {
ensureDirSync(path.dirname(dest)); ensureDirSync(path.dirname(dest));
// TODO(axetroy): remove this if condition. refs: https://github.com/denoland/deno/issues/2169 Deno.symlinkSync(src, dest, srcFilePathType);
if (isWindows) {
Deno.symlinkSync(src, dest, srcFilePathType || undefined);
} else {
Deno.symlinkSync(src, dest);
}
} }