-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
executable file
·29 lines (25 loc) · 763 Bytes
/
index.js
File metadata and controls
executable file
·29 lines (25 loc) · 763 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 prompts = require('prompts'),
program = require('commander'),
git = require('./src/git'),
action = require('./src/action'),
package_json = require('./package.json');
program.version(package_json.version, '-v, --version')
.command('init [tpl] [project]')
.description('初始化模板')
.action((tpl, project) => {
// console.log(process.argv)
require('./src/init').handle({
tpl: tpl,
project: project
})
})
program.usage('[options] <params ...>')
.action(function (options, params) {
require('./src/npm').handle({
options,
params,
args: process.argv.slice(2)
})
})
program.parse(process.argv);