mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
const childProcess = require('child_process');
|
||||
const { writeFileSync } = require('fs');
|
||||
|
||||
const rootDir = __dirname.replace('\\version','');
|
||||
|
||||
const longSHA = childProcess.execSync("git rev-parse HEAD").toString().trim();
|
||||
const shortSHA = childProcess.execSync("git rev-parse --short HEAD").toString().trim();
|
||||
const branch = childProcess.execSync('git rev-parse --abbrev-ref HEAD').toString().trim();
|
||||
@@ -8,7 +10,7 @@ const authorName = childProcess.execSync("git log -1 --pretty=format:'%an'").toS
|
||||
const commitTime = childProcess.execSync("git log -1 --pretty=format:'%cd'").toString().trim();
|
||||
const commitMsg = childProcess.execSync("git log -1 --pretty=%B").toString().trim();
|
||||
const totalCommitCount = childProcess.execSync("git rev-list --count HEAD").toString().trim();
|
||||
// const change = childProcess.execSync(``).toString().trim();
|
||||
const change = childProcess.execSync(`git diff -- ":!/version/git-version.ts" ":!/version/git-version.json" `,{cwd: rootDir }).toString().trim();
|
||||
|
||||
const versionInfo = {
|
||||
shortSHA: shortSHA,
|
||||
@@ -18,7 +20,7 @@ const versionInfo = {
|
||||
lastCommitTime: commitTime,
|
||||
lastCommitMessage: commitMsg,
|
||||
lastCommitNumber: totalCommitCount,
|
||||
// change
|
||||
change
|
||||
}
|
||||
|
||||
const versionInfoJson = JSON.stringify(versionInfo, null, 2);
|
||||
|
||||
Reference in New Issue
Block a user