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 | .option("--combo", "是否打combo包")
|
27 | .option("--aosVersion <aosVersion>", "aos打包版本")
|
28 | .option("--path <path>", "业务自定义节点对应的ftp path")
|
29 | .option("--publishVersion <publishVersion>", "发布版本")
|
30 | .description("发布业务代码包")
|
31 | .action(command("publish-business/index"));
|
32 |
|
33 | commander
|
34 | .command("bundle-framework")
|
35 | .option("--platforms <platforms>", "要打包的平台")
|
36 | .option("--version <version>", "要打包的框架版本")
|
37 | .description("打包框架")
|
38 | .action(command("bundle-framework"));
|
39 |
|
40 | commander
|
41 | .command("publish-framework")
|
42 | .option("--platforms <platforms>", "要打包的平台")
|
43 | .option("--zipname <zipname>", "打包名")
|
44 | .option("--ios-zipname <ios-zipname>", "ios打包名")
|
45 | .option("--android-zipname <android-zipname>", "android打包名")
|
46 | .option("--version <version>", "要打包的框架版本")
|
47 | .option("--release", "是否打release包")
|
48 | .option("--push-branch <push-branch>", "提交到的git仓库分支")
|
49 | .description("发布框架框架包")
|
50 | .action(command("publish-framework"));
|
51 |
|
52 | commander
|
53 | .command("pm-publish")
|
54 | .option("--dir <dir>", "模块所在的git目录")
|
55 | .option("--version <version>", "要发布的版本")
|
56 | .description("发布npm包")
|
57 | .action(command("npm-publish"));
|
58 |
|
59 | commander
|
60 | .command("publish-loader")
|
61 | .option("--version <version>", "要发布的版本")
|
62 | .description("发布loader")
|
63 | .action(command("publish-loader/index"));
|
64 |
|
65 | commander
|
66 | .command("publish-web-framework")
|
67 | .description("")
|
68 | .action(command("publish-web-framework"));
|
69 |
|
70 | commander
|
71 | .command("publish-web-business")
|
72 | .option("--platform <platform>", "要打包的平台")
|
73 | .description("拆包版web发布")
|
74 | .action(command("publish-web-business"));
|
75 |
|
76 | commander
|
77 | .command("output-page-script")
|
78 | .option("--platform <platform>", "要打包的平台")
|
79 | .option("--env <env>", "打包环境")
|
80 | .description("输出页面脚本")
|
81 | .action(command("output-page-script"));
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | commander.parse(process.argv); |
\ | No newline at end of file |