mirror of
https://gitee.com/ant-design-vue/ant-design-vue.git
synced 2024-12-16 01:41:15 +08:00
28 lines
559 B
JavaScript
28 lines
559 B
JavaScript
#!/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();
|
|
}
|