-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
52 lines (47 loc) · 886 Bytes
/
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
import dotenv from 'dotenv';
import runBuild from './src/build.js';
// import runTest from './src/test.js';
import { setState } from './src/utils/store.js';
/**
* 任务
* build | release
* 打包 | 发布
*/
const task = process.argv[2];
/**
* 平台
*/
const platform = process.argv[3];
/**
* 项目
*/
const project = process.argv[4];
/**
* git分支
*/
const targetGitBranch = process.argv[5];
setState({
task,
project,
platform,
targetGitBranch,
});
dotenv.config();
function dispatchTask() {
switch (task) {
case 'build':
console.log('开始构建任务.....');
runBuild();
break;
case 'release':
console.log('开始发布任务.....');
break;
case 'test':
// runTest();
break;
default:
console.log('任务类型不支持[中断程序]', task);
process.exit(-1);
}
}
dispatchTask();