This commit is contained in:
Peter Maquiran
2022-12-22 17:59:49 +01:00
parent 8154751385
commit d8ac3d3b3d
2 changed files with 12 additions and 12 deletions
+6 -6
View File
@@ -1,10 +1,10 @@
{ {
"shortSHA": "1c9309df4", "shortSHA": "815475138",
"SHA": "1c9309df41d9f8786c2ae8f112f05c131000e393", "SHA": "8154751385fa50fd6a08d35ca640ef68a684f158",
"branch": "develop_bitOut-fix", "branch": "develop_bitOut-fix",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Thu Dec 22 17:29:24 2022 +0100'", "lastCommitTime": "'Thu Dec 22 17:58:55 2022 +0100'",
"lastCommitMessage": "change version", "lastCommitMessage": "save",
"lastCommitNumber": "4567", "lastCommitNumber": "4568",
"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);" "change": ""
} }
+6 -6
View File
@@ -1,10 +1,10 @@
export let versionData = { export let versionData = {
"shortSHA": "1c9309df4", "shortSHA": "815475138",
"SHA": "1c9309df41d9f8786c2ae8f112f05c131000e393", "SHA": "8154751385fa50fd6a08d35ca640ef68a684f158",
"branch": "develop_bitOut-fix", "branch": "develop_bitOut-fix",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Thu Dec 22 17:29:24 2022 +0100'", "lastCommitTime": "'Thu Dec 22 17:58:55 2022 +0100'",
"lastCommitMessage": "change version", "lastCommitMessage": "save",
"lastCommitNumber": "4567", "lastCommitNumber": "4568",
"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);" "change": ""
} }