feat: use commit time as version id

This commit is contained in:
Yidadaa
2023-05-04 00:12:00 +08:00
parent 074bd9f045
commit fce3b3ce7b
3 changed files with 30 additions and 12 deletions

View File

@@ -1,13 +1,10 @@
const COMMIT_ID: string = (() => {
try {
const childProcess = require("child_process");
return (
childProcess
// .execSync("git describe --tags --abbrev=0")
.execSync("git rev-parse --short HEAD")
.toString()
.trim()
);
return childProcess
.execSync('git log -1 --format="%at000" --date=unix')
.toString()
.trim();
} catch (e) {
console.error("[Build Config] No git or not from git repo.");
return "unknown";