mirror of
https://github.com/moeru-ai/airi.git
synced 2026-08-14 00:48:06 +00:00
fix(stage-tamagotchi): updater path and exit (#1867)
This commit is contained in:
@@ -132,6 +132,7 @@ export default {
|
||||
deleteAppDataOnUninstall: true,
|
||||
oneClick: false,
|
||||
allowToChangeInstallationDirectory: true,
|
||||
runAfterFinish: true,
|
||||
},
|
||||
mac: {
|
||||
entitlementsInherit: 'build/entitlements.mac.plist',
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user