-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
executable file
·55 lines (49 loc) · 1.88 KB
/
index.js
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env node
'use static';
const program = require('commander');
const pkg = require('./package.json');
const branch = require('./script/branch');
const acmp = require('./script/acmp');
const start = require('./script/start');
const finsh = require('./script/finsh');
//check allready install git
require('./script/helpers/git');
program
.command('acmp [msg]')
.alias('cm')
.description('one line command commit code')
.option('--feat', 'Add new feature')
.option('--fix', 'Fix bug, hotfix')
.option('--style', 'Document related')
.option('--docs', 'Style modification, word modification, formatting, etc.')
.option('--refactor', 'Refactor')
.option('--perf', 'Improve performance')
.option('--test', 'Test related')
.option('--chore','Business-unrelated modification')
.option('--deps','upgrade deps')
.option('--release','Release version')
.option('--other','Other modification')
.action(acmp);
program
.version(pkg.version)
.command('branch [brname] [baseBranch]')
.description('checkout new branch by other branch(default develop branch)')
.alias('br')
.action(branch);
program
.command('start')
.description('start iterating and branch switching')
.alias('s')
.option('-f, --feature <name>', 'Branch prefixed with feature')
.option('-x, --hotfix <name>', 'Branch prefixed with hotfix')
.option('-r, --release <name>', 'Branch prefixed with release')
.action(start);
program
.command('finsh [tagVersion]')
.description('finsh iterating and branch switching,[tagVersion] is optional, default is the branch name without package prefix, but must be the same as the version in package.json.')
.alias('f')
.option('-f, --feature <name>', 'Branch prefixed with feature')
.option('-x, --hotfix <name>', 'Branch prefixed with hotfix')
.option('-r, --release <name>', 'Branch prefixed with release')
.action(finsh);
program.parse(process.argv);