2018-03-18 19:59:38 +08:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
'use strict';
|
2018-03-18 19:59:38 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
require('colorful').colorful();
|
|
|
|
const gulp = require('gulp');
|
|
|
|
const program = require('commander');
|
2018-03-18 19:59:38 +08:00
|
|
|
|
|
|
|
program.on('--help', () => {
|
2019-01-12 11:33:27 +08:00
|
|
|
console.log(' Usage:'.to.bold.blue.color);
|
|
|
|
console.log();
|
|
|
|
});
|
2018-03-18 19:59:38 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
program.parse(process.argv);
|
2018-03-18 19:59:38 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
const task = program.args[0];
|
2018-03-18 19:59:38 +08:00
|
|
|
|
|
|
|
if (!task) {
|
2019-01-12 11:33:27 +08:00
|
|
|
program.help();
|
2018-03-18 19:59:38 +08:00
|
|
|
} else {
|
2019-01-12 11:33:27 +08:00
|
|
|
console.log('antd-tools run', task);
|
2018-03-18 19:59:38 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
require('../gulpfile');
|
2018-03-18 19:59:38 +08:00
|
|
|
|
2019-01-12 11:33:27 +08:00
|
|
|
gulp.start(task);
|
2018-03-18 19:59:38 +08:00
|
|
|
}
|