2020-10-13 01:40:21 +08:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
import chalk from 'chalk';
|
|
|
|
import { argv } from 'yargs';
|
|
|
|
|
|
|
|
import { runChangeLog } from './changelog';
|
|
|
|
import { runPostInstall } from './postinstall';
|
|
|
|
import { runPreview } from './preview';
|
2020-10-16 22:28:44 +08:00
|
|
|
// import { runPreserve } from './preserve';
|
2020-10-13 01:40:21 +08:00
|
|
|
import { runBuild } from './build';
|
|
|
|
|
|
|
|
const task = (argv._ || [])[0];
|
|
|
|
|
|
|
|
console.log('Run Task: ' + chalk.cyan(task));
|
|
|
|
|
|
|
|
switch (task) {
|
|
|
|
// change log
|
|
|
|
case 'log':
|
|
|
|
runChangeLog();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'build':
|
|
|
|
runBuild();
|
|
|
|
break;
|
|
|
|
|
2020-10-16 22:28:44 +08:00
|
|
|
// case 'preserve':
|
|
|
|
// runPreserve();
|
|
|
|
// break;
|
2020-10-13 01:40:21 +08:00
|
|
|
|
|
|
|
case 'postinstall':
|
|
|
|
runPostInstall();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case 'preview':
|
|
|
|
runPreview();
|
|
|
|
break;
|
|
|
|
|
|
|
|
// TODO
|
|
|
|
case 'gzip':
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
export default {};
|