diff options
Diffstat (limited to 'cli/js/ops/fs/chmod.ts')
-rw-r--r-- | cli/js/ops/fs/chmod.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cli/js/ops/fs/chmod.ts b/cli/js/ops/fs/chmod.ts index 91e898360..76a3c8f49 100644 --- a/cli/js/ops/fs/chmod.ts +++ b/cli/js/ops/fs/chmod.ts @@ -1,10 +1,13 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { sendSync, sendAsync } from "../dispatch_json.ts"; +import { pathFromURL } from "../../util.ts"; -export function chmodSync(path: string, mode: number): void { +export function chmodSync(path: string | URL, mode: number): void { + path = pathFromURL(path); sendSync("op_chmod", { path, mode }); } -export async function chmod(path: string, mode: number): Promise<void> { +export async function chmod(path: string | URL, mode: number): Promise<void> { + path = pathFromURL(path); await sendAsync("op_chmod", { path, mode }); } |