-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
126 lines (116 loc) · 2.62 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
#!/usr/bin/env node
const program = require('commander');
const cmd = require('./tools/cmd');
const Safe = require('./tools/safe.js');
const SafeTask = require('./tools/safeTask.js');
const SafeAndoridTask = require('./tools/safeAndroidTask.js');
program.version('1.2.0', '-v, --version')
.command('template <name>')
.alias('t')
.description('generate api template')
.action((name) => {
cmd.templateApi(name);
});
/**
* 部署git协议的项目
*/
program.command('templateManage <name>')
.alias('tm')
.description('generate front end template')
.action((name) => {
cmd.templateManage(name);
});
/**
* 部署git协议的项目
*/
program.command('templateTask <name>')
.alias('tt')
.description('generate task template')
.action((name) => {
cmd.templateTask(name);
});
/**
* 部署git协议的项目
*/
program.command('depolyapp <name>')
.alias('d')
.description('depoly server program')
.action((name) => {
cmd.depoly(name);
});
/**
* 部署git协议的项目
*/
program.command('depolyh5 <name>')
.alias('df')
.description('depoly front end program')
.action((name) => {
cmd.depolyH5(name);
});
/**
* 重新生成ssl证书
*/
program.command('ressl')
.description('重新生成ssl证书')
.action(() => {
cmd.ressl();
});
/**
* 配置服务器环境
*/
program.command('install <name>')
.alias('i')
.description('在centos上安装组件,ssl,mysql,nginx,git,mongodb,redis,basic(ssl,mysql,nginx,git,other),other')
.action((name) => {
cmd.install(name);
});
/**
* 配置服务器环境
*/
program.command('push')
.alias('p')
.description('git的push命令封装,add,commit,push')
.action(name => {
cmd.gitcmd('push');
});
/**
* thinkjs项目加密
*/
program.command('safeServer')
.alias('ss')
.description('加密thinkjs项目代码')
.action(name => {
const s = new Safe();
s.thinkjs();
});
/**
* 配置服务器环境
*/
program.command('safeFormatServer')
.alias('ssf')
.description('格式化加密的thinkjs项目代码')
.action(name => {
const s = new Safe();
s.thinkjsFormat();
});
/**
* task项目加密
*/
program.command('safeTask')
.alias('st')
.description('加密task项目代码')
.action(name => {
const s = new SafeTask();
s.task();
});
/**
* task项目加密
*/
program.command('safeAndroidTask')
.alias('sat')
.description('加密安卓task项目代码')
.action(name => {
const s = new SafeAndoridTask();
s.task();
});
program.parse(process.argv);