diff options
author | dubiousjim <dubiousjim@gmail.com> | 2020-03-11 16:14:23 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 16:14:23 -0400 |
commit | a28fa2415f8ae6bad63469a0c9e4dce3197970f9 (patch) | |
tree | 20c404e523a00616b92b358d917c7f8596fe1657 /cli/js/ops/fs/mkdir.ts | |
parent | 72c408ea9d8b4e4fab63ae06f558c778007bb4f1 (diff) |
support permission mode in mkdir (#4286)
Diffstat (limited to 'cli/js/ops/fs/mkdir.ts')
-rw-r--r-- | cli/js/ops/fs/mkdir.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/cli/js/ops/fs/mkdir.ts b/cli/js/ops/fs/mkdir.ts index 4df33a29f..0bd088def 100644 --- a/cli/js/ops/fs/mkdir.ts +++ b/cli/js/ops/fs/mkdir.ts @@ -1,14 +1,16 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { sendSync, sendAsync } from "../dispatch_json.ts"; +type MkdirArgs = { path: string; recursive: boolean; mode?: number }; + // TODO(ry) The complexity in argument parsing is to support deprecated forms of // mkdir and mkdirSync. function mkdirArgs( path: string, optionsOrRecursive?: MkdirOptions | boolean, mode?: number -): { path: string; recursive: boolean; mode: number } { - const args = { path, recursive: false, mode: 0o777 }; +): MkdirArgs { + const args: MkdirArgs = { path, recursive: false }; if (typeof optionsOrRecursive == "boolean") { args.recursive = optionsOrRecursive; if (mode) { @@ -34,7 +36,7 @@ export interface MkdirOptions { recursive?: boolean; /** Permissions to use when creating the directory (defaults to `0o777`, * before the process's umask). - * Does nothing/raises on Windows. */ + * Ignored on Windows. */ mode?: number; } |