zen-gitsync 2.7.10 → 2.7.12
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/package.json +1 -1
- package/src/gitCommit.js +7 -3
- package/src/ui/public/assets/index-Dt5DchJC.js +81 -0
- package/src/ui/public/assets/{index-0TRm0C2H.css → index-txLltFFK.css} +1 -1
- package/src/ui/public/assets/{vendor-BdOLKL5j.js → vendor-VAJ9QkGT.js} +14 -14
- package/src/ui/public/index.html +3 -3
- package/src/ui/server/index.js +195 -10
- package/src/utils/index.js +28 -24
- package/src/ui/public/assets/index-CVhwVTl2.js +0 -79
package/package.json
CHANGED
package/src/gitCommit.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
coloredLog, errorLog, execGitCommand,
|
|
3
|
+
coloredLog, errorLog, execGitCommand, showHelp,
|
|
4
4
|
getCwd, judgePlatform, judgeLog, judgeHelp, exec_exit, judgeUnmerged, formatDuration,
|
|
5
5
|
exec_push, execPull, judgeRemote, execDiff, execAddAndCommit, delay, addScriptToPackageJson, addResetScriptToPackageJson
|
|
6
6
|
} from './utils/index.js';
|
|
@@ -87,7 +87,8 @@ async function createGitCommit(options) {
|
|
|
87
87
|
if (hasLocalChanges) {
|
|
88
88
|
// 检查是否有 --no-diff 参数
|
|
89
89
|
await execDiff()
|
|
90
|
-
|
|
90
|
+
// 获取实际使用的提交信息(可能是用户交互输入的)
|
|
91
|
+
commitMessage = await execAddAndCommit({statusOutput, commitMessage, exit})
|
|
91
92
|
statusOutput.includes('use "git pull') && await execPull()
|
|
92
93
|
|
|
93
94
|
// 检查是否有远程更新
|
|
@@ -96,7 +97,10 @@ async function createGitCommit(options) {
|
|
|
96
97
|
await exec_push({exit, commitMessage})
|
|
97
98
|
} else {
|
|
98
99
|
if (statusOutput.includes('use "git push')) {
|
|
99
|
-
|
|
100
|
+
// 获取最近一次提交的实际信息
|
|
101
|
+
const lastCommitResult = await execGitCommand('git log -1 --pretty=%B', {log: false});
|
|
102
|
+
const actualCommitMessage = lastCommitResult.stdout.trim();
|
|
103
|
+
await exec_push({exit, commitMessage: actualCommitMessage || commitMessage})
|
|
100
104
|
} else if (statusOutput.includes('use "git pull')) {
|
|
101
105
|
await execPull()
|
|
102
106
|
} else {
|