verb
Version:
Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.
31 lines (26 loc) • 535 B
JavaScript
;
var union = require('arr-union');
/**
* Get a value from the config store.
*
* ```sh
* $ --union one=a,b,c
* #=> {one: ['a', 'b', 'c']}
*
* $ --union one=d
* #=> {one: ['a', 'b', 'c', 'd']}
* ```
*/
module.exports = function(app) {
var arr = app.get('argv.union');
var config = app.config;
var args;
if (arr) {
args = arr.split('=');
if (args.length > 1) {
var val = config.get(args[1]);
args[2] = args[2].split(',');
config.set(args[1], union(val, args[2]));
}
}
};