зеркало из https://github.com/microsoft/shelljs.git
minor
This commit is contained in:
Родитель
91cb4ebb66
Коммит
98f3b0b2ef
25
README.md
25
README.md
|
@ -447,6 +447,31 @@ the `callback` gets the arguments `(code, output)`.
|
|||
the current synchronous implementation uses a lot of CPU. This should be getting
|
||||
fixed soon.
|
||||
|
||||
### chmod(octal_mode, file)
|
||||
### chmod(symbolic_mode, file)
|
||||
|
||||
Available options:
|
||||
|
||||
+ `-v`: output a diagnostic for every file processed
|
||||
+ `-c`: like verbose but report only when a change is made
|
||||
+ `-R`: change files and directories recursively
|
||||
|
||||
Examples:
|
||||
|
||||
```javascript
|
||||
chmod(755, '/Users/brandon')
|
||||
chmod('u+x', '/Users/brandon')
|
||||
```
|
||||
|
||||
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.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
||||
|
|
7
shell.js
7
shell.js
|
@ -1143,11 +1143,13 @@ var PERMS = (function (base) {
|
|||
//@
|
||||
//@ ### chmod(octal_mode, file)
|
||||
//@ ### chmod(symbolic_mode, file)
|
||||
//@
|
||||
//@ Available options:
|
||||
//@
|
||||
//@ + `-v`: output a diagnostic for every file processed//@
|
||||
//@ + `-c`: like verbose but report only when a change is made//@
|
||||
//@ + `-R`: change files and directories recursively//@
|
||||
//@
|
||||
//@ Examples:
|
||||
//@
|
||||
//@ ```javascript
|
||||
|
@ -1159,9 +1161,10 @@ var PERMS = (function (base) {
|
|||
//@ 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
|
||||
//@
|
||||
//@ + 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.
|
||||
//@ + There is no "quiet" option since default behavior is to run silent.
|
||||
function _chmod(options, mode, filePattern) {
|
||||
if (!filePattern) {
|
||||
if (options.length > 0 && options.charAt(0) === '-') {
|
||||
|
|
Загрузка…
Ссылка в новой задаче