mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Merge deno_cli_snapshots into deno_cli (#3064)
This commit is contained in:
parent
9049213867
commit
b81e5db17a
148 changed files with 38 additions and 83 deletions
19
cli/js/link.ts
Normal file
19
cli/js/link.ts
Normal file
|
@ -0,0 +1,19 @@
|
|||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||
import { sendSync, sendAsync } from "./dispatch_json.ts";
|
||||
import * as dispatch from "./dispatch.ts";
|
||||
|
||||
/** Synchronously creates `newname` as a hard link to `oldname`.
|
||||
*
|
||||
* Deno.linkSync("old/name", "new/name");
|
||||
*/
|
||||
export function linkSync(oldname: string, newname: string): void {
|
||||
sendSync(dispatch.OP_LINK, { oldname, newname });
|
||||
}
|
||||
|
||||
/** Creates `newname` as a hard link to `oldname`.
|
||||
*
|
||||
* await Deno.link("old/name", "new/name");
|
||||
*/
|
||||
export async function link(oldname: string, newname: string): Promise<void> {
|
||||
await sendAsync(dispatch.OP_LINK, { oldname, newname });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue