-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
executable file
·28 lines (27 loc) · 987 Bytes
/
main.js
File metadata and controls
executable file
·28 lines (27 loc) · 987 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
#! /usr/bin/env node
const cmd = require("commander");
const chalk = require("chalk");
const downGit = require('./src/downLoad')
const options = require('./src/options')
cmd
.option('-d, --debug', 'output extra debugging')
.option('-s, --small', 'small pizza size')
.option('-p, --pizza-type <type>', 'flavour of pizza');
cmd.version('1.0.8');
cmd.command('init').description('初始化模板').action(async (args) => {
// console.log("项目名称", args.args[0])
let projectName = args.args[0]
typeof projectName !== 'string' && (console.log(chalk.red('缺少项目名称,请给项目起个名字!')), process.exit(1))
console.log(chalk.green('塔读脚手架初始化 \n'))
// 填选项
await options( function(arr) {
let branchName = arr.join('-');
console.log(branchName)
// 拉取
downGit(projectName, branchName)
})
// 拉取
// await downGit(projectName)
})
cmd.parse(process.argv)
// console.log(66666)