PATH:
usr
/
local
/
lib
/
node_modules
/
pm2
/
node_modules
/
shelljs
/
src
var common = require('./common'); common.register('set', _set, { allowGlobbing: false, wrapOutput: false, }); //@ //@ ### set(options) //@ //@ Available options: //@ //@ + `+/-e`: exit upon error (`config.fatal`) //@ + `+/-v`: verbose: show all commands (`config.verbose`) //@ + `+/-f`: disable filename expansion (globbing) //@ //@ Examples: //@ //@ ```javascript //@ set('-e'); // exit upon first error //@ set('+e'); // this undoes a "set('-e')" //@ ``` //@ //@ Sets global configuration variables. function _set(options) { if (!options) { var args = [].slice.call(arguments, 0); if (args.length < 2) common.error('must provide an argument'); options = args[1]; } var negate = (options[0] === '+'); if (negate) { options = '-' + options.slice(1); // parseOptions needs a '-' prefix } options = common.parseOptions(options, { 'e': 'fatal', 'v': 'verbose', 'f': 'noglob', }); if (negate) { Object.keys(options).forEach(function (key) { options[key] = !options[key]; }); } Object.keys(options).forEach(function (key) { // Only change the global config if `negate` is false and the option is true // or if `negate` is true and the option is false (aka negate !== option) if (negate !== options[key]) { common.config[key] = options[key]; } }); return; } module.exports = _set;
[-] popd.js
[edit]
[-] ln.js
[edit]
[-] echo.js
[edit]
[-] which.js
[edit]
[-] find.js
[edit]
[-] exec-child.js
[edit]
[-] sed.js
[edit]
[-] cp.js
[edit]
[+]
..
[-] mv.js
[edit]
[-] tail.js
[edit]
[-] cd.js
[edit]
[-] to.js
[edit]
[-] dirs.js
[edit]
[-] cat.js
[edit]
[-] grep.js
[edit]
[-] common.js
[edit]
[-] test.js
[edit]
[-] head.js
[edit]
[-] tempdir.js
[edit]
[-] pushd.js
[edit]
[-] touch.js
[edit]
[-] uniq.js
[edit]
[-] toEnd.js
[edit]
[-] chmod.js
[edit]
[-] mkdir.js
[edit]
[-] error.js
[edit]
[-] ls.js
[edit]
[-] exec.js
[edit]
[-] sort.js
[edit]
[-] rm.js
[edit]
[-] set.js
[edit]
[-] pwd.js
[edit]