@wagq/wa-cli 0.6.41 → 0.6.42
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/command.js +3 -3
- package/lib/checkBranch/index.js +2 -2
- package/package.json +1 -1
package/config/command.js
CHANGED
|
@@ -164,14 +164,14 @@ const command = [
|
|
|
164
164
|
action: vsSetting,
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
|
-
name: "checkBranch",
|
|
167
|
+
name: "checkBranch [target]",
|
|
168
168
|
alias: "ckb",
|
|
169
169
|
description: "检查当前分支",
|
|
170
170
|
action: checkBranch,
|
|
171
171
|
},
|
|
172
172
|
{
|
|
173
|
-
name: "
|
|
174
|
-
alias: "
|
|
173
|
+
name: "clearLibrary",
|
|
174
|
+
alias: "clearLibrary",
|
|
175
175
|
description: "删除目录下node_modules与dist,如果有packages目录则继续下钻",
|
|
176
176
|
action: clear,
|
|
177
177
|
},
|
package/lib/checkBranch/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { execSync } = require("child_process");
|
|
2
2
|
const log = require("../../utils/log.js");
|
|
3
3
|
|
|
4
|
-
const checkBranch = () => {
|
|
4
|
+
const checkBranch = (target) => {
|
|
5
5
|
try {
|
|
6
6
|
const branch = execSync("git rev-parse --abbrev-ref HEAD", {
|
|
7
7
|
encoding: "utf-8",
|
|
@@ -9,7 +9,7 @@ const checkBranch = () => {
|
|
|
9
9
|
|
|
10
10
|
log.info(`当前分支 ${branch}`);
|
|
11
11
|
|
|
12
|
-
if (branch !==
|
|
12
|
+
if (branch !== target) {
|
|
13
13
|
log.error(`错误: 请在 dev 分支上执行该脚本`);
|
|
14
14
|
log.error(`当前分支: ${branch}`);
|
|
15
15
|
process.exit(1);
|