You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
548 B
28 lines
548 B
7 years ago
|
#!/usr/bin/env node
|
||
|
|
||
|
'use strict'
|
||
|
|
||
|
require('colorful').colorful()
|
||
|
|
||
|
const program = require('commander')
|
||
|
const packageInfo = require('../../package.json')
|
||
|
|
||
|
program
|
||
|
.version(packageInfo.version)
|
||
|
.command('run [name]', 'run specified task')
|
||
|
.parse(process.argv)
|
||
|
|
||
|
// https://github.com/tj/commander.js/pull/260
|
||
|
const proc = program.runningCommand
|
||
|
if (proc) {
|
||
|
proc.on('close', process.exit.bind(process))
|
||
|
proc.on('error', () => {
|
||
|
process.exit(1)
|
||
|
})
|
||
|
}
|
||
|
|
||
|
const subCmd = program.args[0]
|
||
|
if (!subCmd || subCmd !== 'run') {
|
||
|
program.help()
|
||
|
}
|