feat(ui): display current git branch in browser tab, header, and nav tabs
- Add branch indicator in browser tab title ([test-gay] GaC-Srtool...) - Add dynamic tab switching updates preserving branch prefix in browser title - Add branch badge in brand header and right-aligned branch pill in navigation tabs - Add scripts/sync-branch.js and version.json for automated branch detection
This commit is contained in:
1 parent
ba4398fe42
commit
fbe6a5f47e
6 files changed
+170
-4
No files matched your search
@@ -0,0 +1,22 @@
|
||||
const fs = require('fs');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
let branch = 'test-gay';
|
||||
try {
|
||||
branch = execSync('git rev-parse --abbrev-ref HEAD', { encoding: 'utf8' }).trim();
|
||||
} catch (_) {
|
||||
try {
|
||||
const head = fs.readFileSync('.git/HEAD', 'utf8');
|
||||
const m = head.match(/ref:\s*refs\/heads\/([^\r\n]+)/);
|
||||
if (m && m[1]) branch = m[1].trim();
|
||||
} catch (__) {}
|
||||
}
|
||||
|
||||
const versionData = {
|
||||
branch,
|
||||
version: '1.0.0',
|
||||
updatedAt: new Date().toISOString()
|
||||
};
|
||||
|
||||
fs.writeFileSync('version.json', JSON.stringify(versionData, null, 2) + '\n');
|
||||
console.log(`[sync-branch] Updated version.json with branch: ${branch}`);
|
||||
Reference in new issue
Block a user