1 | #!/usr/bin/env node
|
2 |
|
3 | import "babel-polyfill";
|
4 | import commander from "commander";
|
5 | import path from "path";
|
6 |
|
7 |
|
8 | function command(commandName){
|
9 | var command = require(path.join(__dirname, "commanders", commandName + ".js")).default;
|
10 | return function(options){
|
11 | command(options);
|
12 | };
|
13 | }
|
14 |
|
15 | commander
|
16 | .command("publish-business")
|
17 | .option("--platforms <platforms>", "要打包的平台")
|
18 | .option("--business-name <business-name>", "要打包的业务名")
|
19 | .option("--ios-zipname [ios-zipname]", "ios打包名")
|
20 | .option("--android-zipname [android-zipname]", "android打包名")
|
21 | .option("--version <version>", "业务版本")
|
22 | .option("--increment", "是否是增量包")
|
23 | .option("--release", "是否打release包")
|
24 | .option("--push-branch [push-branch]", "提交到的git仓库分支")
|
25 | .option("--build-id [build-id]", "打包id,用来标记每次打包")
|
26 | .description("发布业务代码包")
|
27 | .action(command("publish-business"));
|
28 |
|
29 | commander
|
30 | .command("bundle-framework")
|
31 | .option("--platforms <platforms>", "要打包的平台")
|
32 | .option("--version <version>", "要打包的框架版本")
|
33 | .description("打包框架")
|
34 | .action(command("bundle-framework"));
|
35 |
|
36 | commander
|
37 | .command("publish-framework")
|
38 | .option("--platforms <platforms>", "要打包的平台")
|
39 | .option("--zipname <zipname>", "打包名")
|
40 | .option("--ios-zipname <ios-zipname>", "ios打包名")
|
41 | .option("--android-zipname <android-zipname>", "android打包名")
|
42 | .option("--version <version>", "要打包的框架版本")
|
43 | .option("--release", "是否打release包")
|
44 | .option("--push-branch <push-branch>", "提交到的git仓库分支")
|
45 | .description("发布框架框架包")
|
46 | .action(command("publish-framework"));
|
47 |
|
48 | commander
|
49 | .command("npm-publish")
|
50 | .option("--dir <dir>", "模块所在的git目录")
|
51 | .option("--version <version>", "要发布的版本")
|
52 | .description("发布npm包")
|
53 | .action(command("npm-publish"));
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 | commander.parse(process.argv); |
\ | No newline at end of file |