mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-25 00:39:25 +00:00
feat(webui): show app version in avatar menu
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user