aboutsummaryrefslogtreecommitdiff
path: root/node_modules/shelljs/src/set.js
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/shelljs/src/set.js')
-rw-r--r--node_modules/shelljs/src/set.js55
1 files changed, 0 insertions, 55 deletions
diff --git a/node_modules/shelljs/src/set.js b/node_modules/shelljs/src/set.js
deleted file mode 100644
index 238e23e4a..000000000
--- a/node_modules/shelljs/src/set.js
+++ /dev/null
@@ -1,55 +0,0 @@
-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;