2021-03-01 11:38:43 -05:00
|
|
|
const npm = require('./npm.js')
|
|
|
|
const config = require('./config.js')
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2021-03-01 11:38:43 -05:00
|
|
|
const usage = 'npm set <key>=<value> [<key>=<value> ...] (See `npm config`)'
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2021-03-01 11:38:43 -05:00
|
|
|
const completion = config.completion
|
2011-11-21 09:48:45 -08:00
|
|
|
|
2021-03-01 11:38:43 -05:00
|
|
|
const cmd = (args, cb) => {
|
2020-11-01 07:54:36 +01:00
|
|
|
if (!args.length)
|
2021-03-01 11:38:43 -05:00
|
|
|
return cb(usage)
|
2015-10-09 23:13:57 -07:00
|
|
|
npm.commands.config(['set'].concat(args), cb)
|
2011-11-21 09:48:45 -08:00
|
|
|
}
|
2021-03-01 11:38:43 -05:00
|
|
|
|
|
|
|
module.exports = Object.assign(cmd, { usage, completion })
|