fix(stage-tamagotchi): use electron cache path for updater cleanup

This commit is contained in:
Jensen Huang
2026-04-16 22:58:09 +08:00
committed by Neko Ayaka
parent c4a2e88a58
commit 1a11409b1e
@@ -38,14 +38,9 @@ const GITHUB_RELEASE_DOWNLOAD_BASE_URL = 'https://github.com/moeru-ai/airi/relea
const UPDATE_CHANNEL_ENV_KEY = 'AIRI_UPDATE_CHANNEL'
function 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')
}
// NOTICE: Electron resolves the cache directory per platform/app, but the
// shipped type definitions here do not expose `cache`, so we cast the key.
return app.getPath('cache' as Parameters<typeof app.getPath>[0])
}
const UPDATER_DEBUG_CACHE_DIR = join(getCacheRoot(), 'stage-tamagotchi-updater')