Files
doneit-web/version/git-version.json
T
Peter Maquiran 8154751385 save
2022-12-22 17:58:55 +01:00

10 lines
1.8 KiB
JSON

{
"shortSHA": "1c9309df4",
"SHA": "1c9309df41d9f8786c2ae8f112f05c131000e393",
"branch": "develop_bitOut-fix",
"lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Thu Dec 22 17:29:24 2022 +0100'",
"lastCommitMessage": "change version",
"lastCommitNumber": "4567",
"change": "diff --git a/version/git-version.js b/version/git-version.js\nindex de37a33ba..5591e502e 100644\n--- a/version/git-version.js\n+++ b/version/git-version.js\n@@ -1,6 +1,8 @@\n const childProcess = require('child_process');\n const { writeFileSync } = require('fs');\n \n+const rootDir = __dirname.replace('\\\\version','');\n+\n const longSHA = childProcess.execSync(\"git rev-parse HEAD\").toString().trim();\n const shortSHA = childProcess.execSync(\"git rev-parse --short HEAD\").toString().trim();\n const branch = childProcess.execSync('git rev-parse --abbrev-ref HEAD').toString().trim();\n@@ -8,7 +10,7 @@ const authorName = childProcess.execSync(\"git log -1 --pretty=format:'%an'\").toS\n const commitTime = childProcess.execSync(\"git log -1 --pretty=format:'%cd'\").toString().trim();\n const commitMsg = childProcess.execSync(\"git log -1 --pretty=%B\").toString().trim();\n const totalCommitCount = childProcess.execSync(\"git rev-list --count HEAD\").toString().trim();\n-// const change = childProcess.execSync(``).toString().trim();\n+const change = childProcess.execSync(`git diff -- \":!/version/git-version.ts\" \":!/version/git-version.json\" `,{cwd: rootDir }).toString().trim();\n \n const versionInfo = {\n shortSHA: shortSHA,\n@@ -18,7 +20,7 @@ const versionInfo = {\n lastCommitTime: commitTime,\n lastCommitMessage: commitMsg,\n lastCommitNumber: totalCommitCount,\n- // change\n+ change\n }\n \n const versionInfoJson = JSON.stringify(versionInfo, null, 2);"
}