feat(ui): show current commit version and date in admin sidebar
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const { execSync } = require('child_process');
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
function sh(cmd) {
|
||||
try { return execSync(cmd, { encoding: 'utf8' }).trim(); } catch { return ''; }
|
||||
}
|
||||
|
||||
const out = {
|
||||
full: sh('git rev-parse HEAD'),
|
||||
short: sh('git rev-parse --short HEAD'),
|
||||
date: sh('git log -1 --format=%cI')
|
||||
};
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join(__dirname, '..', 'public', 'version.json'),
|
||||
JSON.stringify(out, null, 2)
|
||||
);
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/sh
|
||||
ROOT="$(git rev-parse --show-toplevel)"
|
||||
node "$ROOT/scripts/gen-version.js"
|
||||
Reference in New Issue
Block a user