mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2024-11-14 23:26:18 +00:00
19 lines
496 B
JavaScript
19 lines
496 B
JavaScript
|
exports = module.exports = cmd
|
||
|
|
||
|
var npm = require('../npm.js')
|
||
|
var usage = require('./usage.js')
|
||
|
|
||
|
function cmd (stage) {
|
||
|
function CMD (args, cb) {
|
||
|
npm.commands['run-script']([stage].concat(args), cb)
|
||
|
}
|
||
|
CMD.usage = usage(stage, 'npm ' + stage + ' [-- <args>]')
|
||
|
var installedShallow = require('./completion/installed-shallow.js')
|
||
|
CMD.completion = function (opts, cb) {
|
||
|
installedShallow(opts, function (d) {
|
||
|
return d.scripts && d.scripts[stage]
|
||
|
}, cb)
|
||
|
}
|
||
|
return CMD
|
||
|
}
|