fix(stage-tamagotchi): updater path and exit (#1867)

This commit is contained in:
jensenhuangfan
2026-06-22 15:08:23 +08:00
committed by GitHub
parent 35da67395c
commit aa2ebf13d1
3 changed files with 18 additions and 2 deletions
@@ -132,6 +132,7 @@ export default {
deleteAppDataOnUninstall: true,
oneClick: false,
allowToChangeInstallationDirectory: true,
runAfterFinish: true,
},
mac: {
entitlementsInherit: 'build/entitlements.mac.plist',
+9 -1
View File
@@ -328,12 +328,20 @@ async function handleAppExit() {
skipFileLogging = true
await logIfError('flush file logs', () => fileLogger.close()) // Ensure all logs are flushed
app.exit(exitedNormally ? 0 : 1)
if (!exitedNormally) {
app.exit(1)
}
else {
app.quit()
}
}
process.on('SIGINT', () => handleAppExit())
app.on('before-quit', (event) => {
if (appExiting)
return
event.preventDefault()
handleAppExit()
})
@@ -48,7 +48,14 @@ function getCacheRoot() {
}
function getLegacyCacheRoot() {
return getCacheRoot()
switch (process.platform) {
case 'win32':
return process.env.LOCALAPPDATA || join(process.env.USERPROFILE || '', 'AppData', 'Local')
case 'darwin':
return join(process.env.HOME || '', 'Library', 'Caches')
default:
return process.env.XDG_CACHE_HOME || join(process.env.HOME || '', '.cache')
}
}
const UPDATER_DEBUG_CACHE_DIR = join(getCacheRoot(), 'stage-tamagotchi-updater')