feat(ui): show current commit version and date in admin sidebar

This commit is contained in:
dev
2026-09-23 14:14:29 +03:00
parent 218c3f825d
commit e435b4ad43
5 changed files with 41 additions and 0 deletions
+18
View File
@@ -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)
);
+3
View File
@@ -0,0 +1,3 @@
#!/bin/sh
ROOT="$(git rev-parse --show-toplevel)"
node "$ROOT/scripts/gen-version.js"