From d8ac3d3b3d35cde1a6ea62ac17a02a15a0b66187 Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Thu, 22 Dec 2022 17:59:49 +0100 Subject: [PATCH] improve --- version/git-version.json | 12 ++++++------ version/git-version.ts | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/version/git-version.json b/version/git-version.json index 3a987197e..99b0b6fca 100644 --- a/version/git-version.json +++ b/version/git-version.json @@ -1,10 +1,10 @@ { - "shortSHA": "1c9309df4", - "SHA": "1c9309df41d9f8786c2ae8f112f05c131000e393", + "shortSHA": "815475138", + "SHA": "8154751385fa50fd6a08d35ca640ef68a684f158", "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);" + "lastCommitTime": "'Thu Dec 22 17:58:55 2022 +0100'", + "lastCommitMessage": "save", + "lastCommitNumber": "4568", + "change": "" } \ No newline at end of file diff --git a/version/git-version.ts b/version/git-version.ts index 7df710143..8bfec520d 100644 --- a/version/git-version.ts +++ b/version/git-version.ts @@ -1,10 +1,10 @@ export let versionData = { - "shortSHA": "1c9309df4", - "SHA": "1c9309df41d9f8786c2ae8f112f05c131000e393", + "shortSHA": "815475138", + "SHA": "8154751385fa50fd6a08d35ca640ef68a684f158", "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);" + "lastCommitTime": "'Thu Dec 22 17:58:55 2022 +0100'", + "lastCommitMessage": "save", + "lastCommitNumber": "4568", + "change": "" } \ No newline at end of file