@wzyjs/cli 0.0.28 → 0.0.31
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.
|
@@ -37,8 +37,14 @@ function execGitCommand(command) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
exports.default = async (options) => {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
const hasChange = await execGitCommand('git status -s');
|
|
41
|
+
if (hasChange) {
|
|
42
|
+
if (options?.commit) {
|
|
43
|
+
console.log('commit success', await execGitCommand(`git commit -a -m "${(await getLatestCommitMsg()).trim()}"`));
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
console.log('stash success', await execGitCommand('git stash'));
|
|
47
|
+
}
|
|
42
48
|
}
|
|
43
49
|
const count = options?.count || await getContinuousCommitCount();
|
|
44
50
|
const command = `GIT_EDITOR=true GIT_SEQUENCE_EDITOR="sed -i -e '2,\\$s/^pick/squash/'" git rebase -i HEAD~${count}`;
|
|
@@ -46,4 +52,7 @@ exports.default = async (options) => {
|
|
|
46
52
|
if (options?.push) {
|
|
47
53
|
console.log('push success', await execGitCommand('git push origin HEAD --force'));
|
|
48
54
|
}
|
|
55
|
+
if (hasChange && !options?.commit) {
|
|
56
|
+
await execGitCommand('git stash pop');
|
|
57
|
+
}
|
|
49
58
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wzyjs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.31",
|
|
4
4
|
"description": "description",
|
|
5
5
|
"author": "wzy",
|
|
6
6
|
"license": "ISC",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@midwayjs/command-core": "^1.3.14",
|
|
22
22
|
"@midwayjs/hooks": "^3.0.1",
|
|
23
23
|
"@umijs/plugins": "^4.0.28",
|
|
24
|
-
"@wzyjs/utils": "^0.0.
|
|
24
|
+
"@wzyjs/utils": "^0.0.31",
|
|
25
25
|
"cac": "^6.7.14",
|
|
26
26
|
"fs-extra": "^10.1.0",
|
|
27
27
|
"rc-field-form": "^1.32.2",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"type": "git",
|
|
43
43
|
"url": "https://gitee.com/wang-zhenyu/app.git"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "eb60e54549c1be64d94b0a4864dacd1f4ed97473"
|
|
46
46
|
}
|