mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
[shelljs] Add missing chmod types (#25332)
This commit is contained in:
committed by
Wesley Wigham
parent
a484c88872
commit
1462bc999b
Vendored
+21
@@ -2,6 +2,7 @@
|
||||
// Project: http://shelljs.org
|
||||
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>
|
||||
// Vojtech Jasny <https://github.com/voy>
|
||||
// George Kalpakas <https://github.com/gkalpak>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node"/>
|
||||
@@ -381,6 +382,16 @@ export type ShellArray = string[] & ShellReturnValue;
|
||||
*/
|
||||
export function chmod(octalMode: number, file: string): void;
|
||||
|
||||
/**
|
||||
* Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
|
||||
* - In symbolic modes, 'a-r' and '-r' are identical. No consideration is given to the umask.
|
||||
* - There is no "quiet" option since default behavior is to run silent.
|
||||
* @param options Available options: -v (output a diagnostic for every file processed), -c (like -v but report only when a change is made), -R (change files and directories recursively)
|
||||
* @param octalMode The access mode. Octal.
|
||||
* @param file The file to use.
|
||||
*/
|
||||
export function chmod(options: string, octalMode: number, file: string): void;
|
||||
|
||||
/**
|
||||
* Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
|
||||
* - In symbolic modes, 'a-r' and '-r' are identical. No consideration is given to the umask.
|
||||
@@ -390,6 +401,16 @@ export function chmod(octalMode: number, file: string): void;
|
||||
*/
|
||||
export function chmod(mode: string, file: string): void;
|
||||
|
||||
/**
|
||||
* Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
|
||||
* - In symbolic modes, 'a-r' and '-r' are identical. No consideration is given to the umask.
|
||||
* - There is no "quiet" option since default behavior is to run silent.
|
||||
* @param options Available options: -v (output a diagnostic for every file processed), -c (like -v but report only when a change is made), -R (change files and directories recursively)
|
||||
* @param mode The access mode. Can be an octal string or a symbolic mode string.
|
||||
* @param file The file to use.
|
||||
*/
|
||||
export function chmod(options: string, mode: string, file: string): void;
|
||||
|
||||
// Non-Unix commands
|
||||
|
||||
/**
|
||||
|
||||
@@ -116,6 +116,8 @@ shell.set('-f');
|
||||
shell.chmod(755, "/Users/brandon");
|
||||
shell.chmod("755", "/Users/brandon"); // same as above
|
||||
shell.chmod("u+x", "/Users/brandon");
|
||||
shell.chmod("-cR", 755, "/Users/brandon");
|
||||
shell.chmod("-Rv", "u+x", "/Users/brandon");
|
||||
|
||||
shell.exit(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user