feat(webui): show app version in avatar menu

This commit is contained in:
yiling
2026-06-19 22:34:12 +08:00
parent 7753721731
commit 5542538a64
4 changed files with 54 additions and 1 deletions
+16
View File
@@ -91,6 +91,22 @@ function updateVersions(newVersion: string) {
writeFileSync(file, JSON.stringify(content, null, 2) + '\n', 'utf-8')
console.log(` Updated version in ${file}`)
}
if (existsSync('bunfig.toml')) {
let content = readFileSync('bunfig.toml', 'utf-8')
const appVersionLine = `"__APP_VERSION__" = "'${newVersion}'"`
if (content.includes('__APP_VERSION__')) {
content = content.replace(/"__APP_VERSION__"\s*=\s*['"].*?['"]/, appVersionLine)
} else {
if (content.includes('[define]')) {
content = content.replace('[define]', `[define]\n${appVersionLine}`)
} else {
content = content.trimEnd() + `\n\n[define]\n${appVersionLine}\n`
}
}
writeFileSync('bunfig.toml', content, 'utf-8')
console.log(' Updated version in bunfig.toml')
}
}
function shellQuote(value: string) {