forked from lgwebdream/fe-code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfe
More file actions
executable file
·29 lines (29 loc) · 933 Bytes
/
fe
File metadata and controls
executable file
·29 lines (29 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env node
const { program } = require('commander');
const figlet = require('figlet');
const versionStr = figlet.textSync('Fe Code');
const Printer = require('@darkobits/lolcatjs');
const shell = require('shelljs');
const json2ts = require('json2ts');
const _version = require('../package.json').version;
const chalk = require('chalk');
const inquirer = require('inquirer');
const ora = require('ora');
const download = require('download-git-repo');
program.version(
Printer.default.fromString(
` \n 前端代码生成器${_version}\n www.yifengfe.com \n${versionStr}`
)
);
program
.usage('[cmd] <options>')
.arguments('<cmd> [env]')
.action(function (cmd, otherParmas) {
const handler = bindHandler[cmd];
if (typeof handler === 'undefined') {
console.log(chalk.blue(`${cmd}`) + chalk.red('暂未支持'));
} else {
handler(otherParmas);
}
});
program.parse(process.argv);