diff options
author | Ali Hasani <a.hassssani@gmail.com> | 2020-05-19 03:16:02 +0430 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-19 00:46:02 +0200 |
commit | 6072755eadb7342a409f43260e5a17b956703a1c (patch) | |
tree | 35ec9b10eddafdc2b0dacecc439aa8d9f785529a /cli/js/ops | |
parent | 88b24261ba467c20d4ef90224b07c19a71398f0f (diff) |
Implement Deno.symlink() for windows (#5533)
Diffstat (limited to 'cli/js/ops')
-rw-r--r-- | cli/js/ops/fs/symlink.ts | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/cli/js/ops/fs/symlink.ts b/cli/js/ops/fs/symlink.ts index 64074ec2d..fde611b55 100644 --- a/cli/js/ops/fs/symlink.ts +++ b/cli/js/ops/fs/symlink.ts @@ -1,26 +1,22 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { sendSync, sendAsync } from "../dispatch_json.ts"; -import * as util from "../../util.ts"; -import { build } from "../../build.ts"; + +export type symlinkOptions = { + type: "file" | "dir"; +}; export function symlinkSync( oldpath: string, newpath: string, - type?: string + options?: symlinkOptions ): void { - if (build.os === "windows" && type) { - return util.notImplemented(); - } - sendSync("op_symlink", { oldpath, newpath }); + sendSync("op_symlink", { oldpath, newpath, options }); } export async function symlink( oldpath: string, newpath: string, - type?: string + options?: symlinkOptions ): Promise<void> { - if (build.os === "windows" && type) { - return util.notImplemented(); - } - await sendAsync("op_symlink", { oldpath, newpath }); + await sendAsync("op_symlink", { oldpath, newpath, options }); } |