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
22
cli/js/dir.ts
Normal file
22
cli/js/dir.ts
Normal file
|
@ -0,0 +1,22 @@
|
|||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||
import { sendSync } from "./dispatch_json.ts";
|
||||
import * as dispatch from "./dispatch.ts";
|
||||
|
||||
/**
|
||||
* `cwd()` Return a string representing the current working directory.
|
||||
* If the current directory can be reached via multiple paths
|
||||
* (due to symbolic links), `cwd()` may return
|
||||
* any one of them.
|
||||
* throws `NotFound` exception if directory not available
|
||||
*/
|
||||
export function cwd(): string {
|
||||
return sendSync(dispatch.OP_CWD);
|
||||
}
|
||||
|
||||
/**
|
||||
* `chdir()` Change the current working directory to path.
|
||||
* throws `NotFound` exception if directory not available
|
||||
*/
|
||||
export function chdir(directory: string): void {
|
||||
sendSync(dispatch.OP_CHDIR, { directory });
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue