ee-bin 4.1.10 → 4.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/bin_default.js +181 -181
- package/index.js +120 -120
- package/lib/extend.js +77 -77
- package/lib/pargv.js +263 -263
- package/lib/utils.js +255 -255
- package/package.json +32 -32
- package/tools/encrypt.js +178 -178
- package/tools/iconGen.js +182 -182
- package/tools/incrUpdater.js +195 -195
- package/tools/move.js +68 -68
- package/tools/serve.js +346 -346
package/config/bin_default.js
CHANGED
|
@@ -1,182 +1,182 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ee-bin 配置
|
|
3
|
-
* 仅适用于开发环境
|
|
4
|
-
*/
|
|
5
|
-
module.exports = {
|
|
6
|
-
/**
|
|
7
|
-
* development serve ("frontend" "electron" )
|
|
8
|
-
* ee-bin dev
|
|
9
|
-
*/
|
|
10
|
-
dev: {
|
|
11
|
-
frontend: {
|
|
12
|
-
directory: './frontend',
|
|
13
|
-
cmd: 'npm',
|
|
14
|
-
args: ['run', 'dev'],
|
|
15
|
-
protocol: 'http://',
|
|
16
|
-
hostname: 'localhost',
|
|
17
|
-
port: 8080,
|
|
18
|
-
indexPath: 'index.html',
|
|
19
|
-
force: false,
|
|
20
|
-
sync: false,
|
|
21
|
-
},
|
|
22
|
-
electron: {
|
|
23
|
-
directory: './',
|
|
24
|
-
cmd: 'electron',
|
|
25
|
-
args: ['.', '--env=local', '--debugger=false'],
|
|
26
|
-
loadingPage: '/public/html/loading.html',
|
|
27
|
-
watch: false,
|
|
28
|
-
sync: false,
|
|
29
|
-
delay: 1000,
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* 构建
|
|
35
|
-
* ee-bin build
|
|
36
|
-
*/
|
|
37
|
-
build: {
|
|
38
|
-
frontend: {
|
|
39
|
-
directory: './frontend',
|
|
40
|
-
cmd: 'npm',
|
|
41
|
-
args: ['run', 'build'],
|
|
42
|
-
},
|
|
43
|
-
electron: {
|
|
44
|
-
type: 'javascript',
|
|
45
|
-
bundler: 'esbuild',
|
|
46
|
-
bundleType: 'bundle', // copy | bundle
|
|
47
|
-
javascript: {
|
|
48
|
-
entryPoints: ['./electron/**/*.js'],
|
|
49
|
-
platform: 'node',
|
|
50
|
-
bundle: false,
|
|
51
|
-
minify: false,
|
|
52
|
-
outdir: 'public/electron',
|
|
53
|
-
packages: 'external',
|
|
54
|
-
sourcemap:false,
|
|
55
|
-
sourcesContent: false
|
|
56
|
-
},
|
|
57
|
-
typescript: {
|
|
58
|
-
entryPoints: ['./electron/**/*.ts'],
|
|
59
|
-
tsconfig: './tsconfig.json',
|
|
60
|
-
platform: 'node',
|
|
61
|
-
format: 'cjs',
|
|
62
|
-
bundle: false,
|
|
63
|
-
minify: false,
|
|
64
|
-
outdir: 'public/electron',
|
|
65
|
-
packages: 'external',
|
|
66
|
-
sourcemap:false,
|
|
67
|
-
sourcesContent: false
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
win32: {
|
|
71
|
-
cmd: 'electron-builder',
|
|
72
|
-
directory: './',
|
|
73
|
-
args: ['--config=./cmd/builder.json', '-w=nsis', '--ia32'],
|
|
74
|
-
},
|
|
75
|
-
win64: {
|
|
76
|
-
cmd: 'electron-builder',
|
|
77
|
-
directory: './',
|
|
78
|
-
args: ['--config=./cmd/builder.json', '-w=nsis', '--x64'],
|
|
79
|
-
},
|
|
80
|
-
win_e: {
|
|
81
|
-
cmd: 'electron-builder',
|
|
82
|
-
directory: './',
|
|
83
|
-
args: ['--config=./cmd/builder.json', '-w=portable', '--x64'],
|
|
84
|
-
},
|
|
85
|
-
win_7z: {
|
|
86
|
-
cmd: 'electron-builder',
|
|
87
|
-
directory: './',
|
|
88
|
-
args: ['--config=./cmd/builder.json', '-w=7z', '--x64'],
|
|
89
|
-
},
|
|
90
|
-
mac: {
|
|
91
|
-
cmd: 'electron-builder',
|
|
92
|
-
directory: './',
|
|
93
|
-
args: ['--config=./cmd/builder-mac.json', '-m'],
|
|
94
|
-
},
|
|
95
|
-
mac_arm64: {
|
|
96
|
-
cmd: 'electron-builder',
|
|
97
|
-
directory: './',
|
|
98
|
-
args: ['--config=./cmd/builder-mac-arm64.json', '-m', '--arm64'],
|
|
99
|
-
},
|
|
100
|
-
linux: {
|
|
101
|
-
cmd: 'electron-builder',
|
|
102
|
-
directory: './',
|
|
103
|
-
args: ['--config=./cmd/builder-linux.json', '-l=deb', '--x64'],
|
|
104
|
-
},
|
|
105
|
-
linux_arm64: {
|
|
106
|
-
cmd: 'electron-builder',
|
|
107
|
-
directory: './',
|
|
108
|
-
args: ['--config=./cmd/builder-linux.json', '-l=deb', '--arm64'],
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* 移动资源
|
|
114
|
-
* ee-bin move
|
|
115
|
-
*/
|
|
116
|
-
move: {
|
|
117
|
-
frontend_dist: {
|
|
118
|
-
src: './frontend/dist',
|
|
119
|
-
dest: './public/dist'
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* 预发布模式(prod)
|
|
125
|
-
* ee-bin start
|
|
126
|
-
*/
|
|
127
|
-
start: {
|
|
128
|
-
directory: './',
|
|
129
|
-
cmd: 'electron',
|
|
130
|
-
args: ['.', '--env=prod']
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
/**
|
|
134
|
-
* 加密
|
|
135
|
-
*/
|
|
136
|
-
encrypt: {
|
|
137
|
-
frontend: {
|
|
138
|
-
type: 'none',
|
|
139
|
-
files: [
|
|
140
|
-
'./public/dist/**/*.(js|json)',
|
|
141
|
-
],
|
|
142
|
-
fileExt: ['.js'],
|
|
143
|
-
cleanFiles: ['./public/dist'],
|
|
144
|
-
specificFiles: [],
|
|
145
|
-
encryptDir: './',
|
|
146
|
-
confusionOptions: {
|
|
147
|
-
compact: true,
|
|
148
|
-
stringArray: true,
|
|
149
|
-
stringArrayEncoding: ['none'],
|
|
150
|
-
deadCodeInjection: false,
|
|
151
|
-
stringArrayCallsTransform: true,
|
|
152
|
-
numbersToExpressions: true,
|
|
153
|
-
target: 'browser',
|
|
154
|
-
}
|
|
155
|
-
},
|
|
156
|
-
electron: {
|
|
157
|
-
type: 'none',
|
|
158
|
-
files: [
|
|
159
|
-
'./public/electron/**/*.(js|json)',
|
|
160
|
-
],
|
|
161
|
-
fileExt: ['.js'],
|
|
162
|
-
cleanFiles: ['./public/electron'],
|
|
163
|
-
specificFiles: ['./public/electron/preload/bridge.js'],
|
|
164
|
-
encryptDir: './',
|
|
165
|
-
confusionOptions: {
|
|
166
|
-
compact: true,
|
|
167
|
-
stringArray: true,
|
|
168
|
-
stringArrayEncoding: ['rc4'],
|
|
169
|
-
deadCodeInjection: false,
|
|
170
|
-
stringArrayCallsTransform: true,
|
|
171
|
-
numbersToExpressions: true,
|
|
172
|
-
target: 'node',
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* 执行自定义命令
|
|
179
|
-
* ee-bin exec
|
|
180
|
-
*/
|
|
181
|
-
exec: {},
|
|
1
|
+
/**
|
|
2
|
+
* ee-bin 配置
|
|
3
|
+
* 仅适用于开发环境
|
|
4
|
+
*/
|
|
5
|
+
module.exports = {
|
|
6
|
+
/**
|
|
7
|
+
* development serve ("frontend" "electron" )
|
|
8
|
+
* ee-bin dev
|
|
9
|
+
*/
|
|
10
|
+
dev: {
|
|
11
|
+
frontend: {
|
|
12
|
+
directory: './frontend',
|
|
13
|
+
cmd: 'npm',
|
|
14
|
+
args: ['run', 'dev'],
|
|
15
|
+
protocol: 'http://',
|
|
16
|
+
hostname: 'localhost',
|
|
17
|
+
port: 8080,
|
|
18
|
+
indexPath: 'index.html',
|
|
19
|
+
force: false,
|
|
20
|
+
sync: false,
|
|
21
|
+
},
|
|
22
|
+
electron: {
|
|
23
|
+
directory: './',
|
|
24
|
+
cmd: 'electron',
|
|
25
|
+
args: ['.', '--env=local', '--debugger=false'],
|
|
26
|
+
loadingPage: '/public/html/loading.html',
|
|
27
|
+
watch: false,
|
|
28
|
+
sync: false,
|
|
29
|
+
delay: 1000,
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* 构建
|
|
35
|
+
* ee-bin build
|
|
36
|
+
*/
|
|
37
|
+
build: {
|
|
38
|
+
frontend: {
|
|
39
|
+
directory: './frontend',
|
|
40
|
+
cmd: 'npm',
|
|
41
|
+
args: ['run', 'build'],
|
|
42
|
+
},
|
|
43
|
+
electron: {
|
|
44
|
+
type: 'javascript',
|
|
45
|
+
bundler: 'esbuild',
|
|
46
|
+
bundleType: 'bundle', // copy | bundle
|
|
47
|
+
javascript: {
|
|
48
|
+
entryPoints: ['./electron/**/*.js'],
|
|
49
|
+
platform: 'node',
|
|
50
|
+
bundle: false,
|
|
51
|
+
minify: false,
|
|
52
|
+
outdir: 'public/electron',
|
|
53
|
+
packages: 'external',
|
|
54
|
+
sourcemap:false,
|
|
55
|
+
sourcesContent: false
|
|
56
|
+
},
|
|
57
|
+
typescript: {
|
|
58
|
+
entryPoints: ['./electron/**/*.ts'],
|
|
59
|
+
tsconfig: './tsconfig.json',
|
|
60
|
+
platform: 'node',
|
|
61
|
+
format: 'cjs',
|
|
62
|
+
bundle: false,
|
|
63
|
+
minify: false,
|
|
64
|
+
outdir: 'public/electron',
|
|
65
|
+
packages: 'external',
|
|
66
|
+
sourcemap:false,
|
|
67
|
+
sourcesContent: false
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
win32: {
|
|
71
|
+
cmd: 'electron-builder',
|
|
72
|
+
directory: './',
|
|
73
|
+
args: ['--config=./cmd/builder.json', '-w=nsis', '--ia32'],
|
|
74
|
+
},
|
|
75
|
+
win64: {
|
|
76
|
+
cmd: 'electron-builder',
|
|
77
|
+
directory: './',
|
|
78
|
+
args: ['--config=./cmd/builder.json', '-w=nsis', '--x64'],
|
|
79
|
+
},
|
|
80
|
+
win_e: {
|
|
81
|
+
cmd: 'electron-builder',
|
|
82
|
+
directory: './',
|
|
83
|
+
args: ['--config=./cmd/builder.json', '-w=portable', '--x64'],
|
|
84
|
+
},
|
|
85
|
+
win_7z: {
|
|
86
|
+
cmd: 'electron-builder',
|
|
87
|
+
directory: './',
|
|
88
|
+
args: ['--config=./cmd/builder.json', '-w=7z', '--x64'],
|
|
89
|
+
},
|
|
90
|
+
mac: {
|
|
91
|
+
cmd: 'electron-builder',
|
|
92
|
+
directory: './',
|
|
93
|
+
args: ['--config=./cmd/builder-mac.json', '-m'],
|
|
94
|
+
},
|
|
95
|
+
mac_arm64: {
|
|
96
|
+
cmd: 'electron-builder',
|
|
97
|
+
directory: './',
|
|
98
|
+
args: ['--config=./cmd/builder-mac-arm64.json', '-m', '--arm64'],
|
|
99
|
+
},
|
|
100
|
+
linux: {
|
|
101
|
+
cmd: 'electron-builder',
|
|
102
|
+
directory: './',
|
|
103
|
+
args: ['--config=./cmd/builder-linux.json', '-l=deb', '--x64'],
|
|
104
|
+
},
|
|
105
|
+
linux_arm64: {
|
|
106
|
+
cmd: 'electron-builder',
|
|
107
|
+
directory: './',
|
|
108
|
+
args: ['--config=./cmd/builder-linux.json', '-l=deb', '--arm64'],
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* 移动资源
|
|
114
|
+
* ee-bin move
|
|
115
|
+
*/
|
|
116
|
+
move: {
|
|
117
|
+
frontend_dist: {
|
|
118
|
+
src: './frontend/dist',
|
|
119
|
+
dest: './public/dist'
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* 预发布模式(prod)
|
|
125
|
+
* ee-bin start
|
|
126
|
+
*/
|
|
127
|
+
start: {
|
|
128
|
+
directory: './',
|
|
129
|
+
cmd: 'electron',
|
|
130
|
+
args: ['.', '--env=prod']
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* 加密
|
|
135
|
+
*/
|
|
136
|
+
encrypt: {
|
|
137
|
+
frontend: {
|
|
138
|
+
type: 'none',
|
|
139
|
+
files: [
|
|
140
|
+
'./public/dist/**/*.(js|json)',
|
|
141
|
+
],
|
|
142
|
+
fileExt: ['.js'],
|
|
143
|
+
cleanFiles: ['./public/dist'],
|
|
144
|
+
specificFiles: [],
|
|
145
|
+
encryptDir: './',
|
|
146
|
+
confusionOptions: {
|
|
147
|
+
compact: true,
|
|
148
|
+
stringArray: true,
|
|
149
|
+
stringArrayEncoding: ['none'],
|
|
150
|
+
deadCodeInjection: false,
|
|
151
|
+
stringArrayCallsTransform: true,
|
|
152
|
+
numbersToExpressions: true,
|
|
153
|
+
target: 'browser',
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
electron: {
|
|
157
|
+
type: 'none',
|
|
158
|
+
files: [
|
|
159
|
+
'./public/electron/**/*.(js|json)',
|
|
160
|
+
],
|
|
161
|
+
fileExt: ['.js'],
|
|
162
|
+
cleanFiles: ['./public/electron'],
|
|
163
|
+
specificFiles: ['./public/electron/preload/bridge.js'],
|
|
164
|
+
encryptDir: './',
|
|
165
|
+
confusionOptions: {
|
|
166
|
+
compact: true,
|
|
167
|
+
stringArray: true,
|
|
168
|
+
stringArrayEncoding: ['rc4'],
|
|
169
|
+
deadCodeInjection: false,
|
|
170
|
+
stringArrayCallsTransform: true,
|
|
171
|
+
numbersToExpressions: true,
|
|
172
|
+
target: 'node',
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* 执行自定义命令
|
|
179
|
+
* ee-bin exec
|
|
180
|
+
*/
|
|
181
|
+
exec: {},
|
|
182
182
|
};
|
package/index.js
CHANGED
|
@@ -1,121 +1,121 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { program } = require('commander');
|
|
4
|
-
const { move } = require('./tools/move');
|
|
5
|
-
const { encrypt, cleanEncrypt } = require('./tools/encrypt');
|
|
6
|
-
const { serveProcess } = require('./tools/serve');
|
|
7
|
-
const { incrUpdater } = require('./tools/incrUpdater');
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* dev
|
|
11
|
-
*/
|
|
12
|
-
program
|
|
13
|
-
.command('dev')
|
|
14
|
-
.description('create frontend-serve and electron-serve')
|
|
15
|
-
.option('--config <folder>', 'config file')
|
|
16
|
-
.option('--serve <mode>', 'serve mode')
|
|
17
|
-
.action(function() {
|
|
18
|
-
serveProcess.dev(this.opts());
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* build
|
|
23
|
-
*/
|
|
24
|
-
program
|
|
25
|
-
.command('build')
|
|
26
|
-
.description('building multiple resources')
|
|
27
|
-
.option('--config <folder>', 'config file')
|
|
28
|
-
.option('--cmds <flag>', 'custom commands')
|
|
29
|
-
.option('--env <env>', 'environment')
|
|
30
|
-
.action(function() {
|
|
31
|
-
serveProcess.build(this.opts());
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* start
|
|
36
|
-
*/
|
|
37
|
-
program
|
|
38
|
-
.command('start')
|
|
39
|
-
.description('preview effect')
|
|
40
|
-
.option('--config <folder>', 'config file')
|
|
41
|
-
.action(function() {
|
|
42
|
-
serveProcess.start(this.opts());
|
|
43
|
-
});
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* exec
|
|
47
|
-
*/
|
|
48
|
-
program
|
|
49
|
-
.command('exec')
|
|
50
|
-
.description('create frontend-serve and electron-serve')
|
|
51
|
-
.option('--config <folder>', 'config file')
|
|
52
|
-
.option('--cmds <flag>', 'custom commands')
|
|
53
|
-
.action(function() {
|
|
54
|
-
serveProcess.exec(this.opts());
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* move - Moves resources
|
|
59
|
-
*/
|
|
60
|
-
program
|
|
61
|
-
.command('move')
|
|
62
|
-
.description('Move multip resources')
|
|
63
|
-
.option('--config <folder>', 'config file')
|
|
64
|
-
.option('--flag <flag>', 'Custom flag')
|
|
65
|
-
.action(function() {
|
|
66
|
-
move(this.opts());
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* encrypt - Code encryption
|
|
71
|
-
*/
|
|
72
|
-
program
|
|
73
|
-
.command('encrypt')
|
|
74
|
-
.description('Code encryption')
|
|
75
|
-
.option('--config <folder>', 'config file')
|
|
76
|
-
.option('--out <folder>', 'output directory')
|
|
77
|
-
.action(function() {
|
|
78
|
-
encrypt(this.opts());
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* clean - Clear the encrypted code
|
|
83
|
-
*/
|
|
84
|
-
program
|
|
85
|
-
.command('clean')
|
|
86
|
-
.description('Clear the encrypted code')
|
|
87
|
-
.option('-d, --dir <folder>', 'clean directory')
|
|
88
|
-
.action(function() {
|
|
89
|
-
cleanEncrypt(this.opts());
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* icon
|
|
94
|
-
*/
|
|
95
|
-
program
|
|
96
|
-
.command('icon')
|
|
97
|
-
.description('Generate logo')
|
|
98
|
-
.option('-i, --input <file>', 'image file default /public/images/logo.png')
|
|
99
|
-
.option('-o, --output <folder>', 'output directory default /build/icons/')
|
|
100
|
-
.option('-s, --size <flag>', 'generate size default 16,32,64,256,512')
|
|
101
|
-
.option('-c, --clear', 'clear output directory first')
|
|
102
|
-
.option('-img, --images <flag>', 'Win window icon/tray image generation path default /public/images/')
|
|
103
|
-
.action(function() {
|
|
104
|
-
const iconGen = require('./tools/iconGen');
|
|
105
|
-
iconGen.run();
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* updater
|
|
110
|
-
*/
|
|
111
|
-
program
|
|
112
|
-
.command('updater')
|
|
113
|
-
.description('updater commands')
|
|
114
|
-
.option('--config <folder>', 'config file')
|
|
115
|
-
.option('--asar-file <file>', 'asar file path')
|
|
116
|
-
.option('--platform <flag>', 'platform')
|
|
117
|
-
.action(function() {
|
|
118
|
-
incrUpdater.run(this.opts());
|
|
119
|
-
});
|
|
120
|
-
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { program } = require('commander');
|
|
4
|
+
const { move } = require('./tools/move');
|
|
5
|
+
const { encrypt, cleanEncrypt } = require('./tools/encrypt');
|
|
6
|
+
const { serveProcess } = require('./tools/serve');
|
|
7
|
+
const { incrUpdater } = require('./tools/incrUpdater');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* dev
|
|
11
|
+
*/
|
|
12
|
+
program
|
|
13
|
+
.command('dev')
|
|
14
|
+
.description('create frontend-serve and electron-serve')
|
|
15
|
+
.option('--config <folder>', 'config file')
|
|
16
|
+
.option('--serve <mode>', 'serve mode')
|
|
17
|
+
.action(function() {
|
|
18
|
+
serveProcess.dev(this.opts());
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* build
|
|
23
|
+
*/
|
|
24
|
+
program
|
|
25
|
+
.command('build')
|
|
26
|
+
.description('building multiple resources')
|
|
27
|
+
.option('--config <folder>', 'config file')
|
|
28
|
+
.option('--cmds <flag>', 'custom commands')
|
|
29
|
+
.option('--env <env>', 'environment')
|
|
30
|
+
.action(function() {
|
|
31
|
+
serveProcess.build(this.opts());
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* start
|
|
36
|
+
*/
|
|
37
|
+
program
|
|
38
|
+
.command('start')
|
|
39
|
+
.description('preview effect')
|
|
40
|
+
.option('--config <folder>', 'config file')
|
|
41
|
+
.action(function() {
|
|
42
|
+
serveProcess.start(this.opts());
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* exec
|
|
47
|
+
*/
|
|
48
|
+
program
|
|
49
|
+
.command('exec')
|
|
50
|
+
.description('create frontend-serve and electron-serve')
|
|
51
|
+
.option('--config <folder>', 'config file')
|
|
52
|
+
.option('--cmds <flag>', 'custom commands')
|
|
53
|
+
.action(function() {
|
|
54
|
+
serveProcess.exec(this.opts());
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* move - Moves resources
|
|
59
|
+
*/
|
|
60
|
+
program
|
|
61
|
+
.command('move')
|
|
62
|
+
.description('Move multip resources')
|
|
63
|
+
.option('--config <folder>', 'config file')
|
|
64
|
+
.option('--flag <flag>', 'Custom flag')
|
|
65
|
+
.action(function() {
|
|
66
|
+
move(this.opts());
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* encrypt - Code encryption
|
|
71
|
+
*/
|
|
72
|
+
program
|
|
73
|
+
.command('encrypt')
|
|
74
|
+
.description('Code encryption')
|
|
75
|
+
.option('--config <folder>', 'config file')
|
|
76
|
+
.option('--out <folder>', 'output directory')
|
|
77
|
+
.action(function() {
|
|
78
|
+
encrypt(this.opts());
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* clean - Clear the encrypted code
|
|
83
|
+
*/
|
|
84
|
+
program
|
|
85
|
+
.command('clean')
|
|
86
|
+
.description('Clear the encrypted code')
|
|
87
|
+
.option('-d, --dir <folder>', 'clean directory')
|
|
88
|
+
.action(function() {
|
|
89
|
+
cleanEncrypt(this.opts());
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* icon
|
|
94
|
+
*/
|
|
95
|
+
program
|
|
96
|
+
.command('icon')
|
|
97
|
+
.description('Generate logo')
|
|
98
|
+
.option('-i, --input <file>', 'image file default /public/images/logo.png')
|
|
99
|
+
.option('-o, --output <folder>', 'output directory default /build/icons/')
|
|
100
|
+
.option('-s, --size <flag>', 'generate size default 16,32,64,256,512')
|
|
101
|
+
.option('-c, --clear', 'clear output directory first')
|
|
102
|
+
.option('-img, --images <flag>', 'Win window icon/tray image generation path default /public/images/')
|
|
103
|
+
.action(function() {
|
|
104
|
+
const iconGen = require('./tools/iconGen');
|
|
105
|
+
iconGen.run();
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* updater
|
|
110
|
+
*/
|
|
111
|
+
program
|
|
112
|
+
.command('updater')
|
|
113
|
+
.description('updater commands')
|
|
114
|
+
.option('--config <folder>', 'config file')
|
|
115
|
+
.option('--asar-file <file>', 'asar file path')
|
|
116
|
+
.option('--platform <flag>', 'platform')
|
|
117
|
+
.action(function() {
|
|
118
|
+
incrUpdater.run(this.opts());
|
|
119
|
+
});
|
|
120
|
+
|
|
121
121
|
program.parse();
|