Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/lib/node_modules/strapi/node_modules/shelljs/src/ drwxr-xr-x | |
| Viewing file: Select action/file-type: 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;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0064 ]-- |