From 6072755eadb7342a409f43260e5a17b956703a1c Mon Sep 17 00:00:00 2001 From: Ali Hasani Date: Tue, 19 May 2020 03:16:02 +0430 Subject: Implement Deno.symlink() for windows (#5533) --- cli/js/ops/fs/symlink.ts | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) (limited to 'cli/js/ops') 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 { - if (build.os === "windows" && type) { - return util.notImplemented(); - } - await sendAsync("op_symlink", { oldpath, newpath }); + await sendAsync("op_symlink", { oldpath, newpath, options }); } -- cgit v1.2.3