输出失败信息方便调试

This commit is contained in:
zhang hongbo 2026-03-25 15:07:14 +08:00
parent b2d1a7a593
commit ce8ae37c30

View File

@ -172,7 +172,7 @@ def call(Map config)
).trim()
def currentHeadMessage = bat(
returnStdout: true,
script: "@echo off\r\ngit -C \"${submodulePath}\" log -1 --pretty=format:\"%h %s - %an\""
script: "@echo off\r\ngit -C \"${submodulePath}\" log -1 --pretty=format:\"%%h %%s - %%an\""
).trim()
currentSubmoduleStates[submodulePath] = [sha: currentSha]
@ -183,7 +183,7 @@ def call(Map config)
try {
commitLogs = bat(
returnStdout: true,
script: "@echo off\r\ngit -C \"${submodulePath}\" log --pretty=format:\"- %h %s - %an\" ${previousSha}..${currentSha}"
script: "@echo off\r\ngit -C \"${submodulePath}\" log --pretty=format:\"- %%h %%s - %%an\" ${previousSha}..${currentSha}"
).trim()
} catch (Exception ignored) {
commitLogs = "- ${currentHeadMessage}"
@ -209,7 +209,8 @@ def call(Map config)
file: submoduleStateFile,
text: JsonOutput.prettyPrint(JsonOutput.toJson(currentSubmoduleStates))
)
} catch (Exception ignored) {
} catch (Exception ex) {
echo "子模块提交记录收集失败: ${ex.message}"
submoduleChangeString = "\n\n子模块提交记录: 收集失败"
}
} else {