From 1a11409b1e3023f605fa4f0bfa17f4aeb93600b5 Mon Sep 17 00:00:00 2001 From: Jensen Huang Date: Mon, 13 Apr 2026 23:30:16 -0400 Subject: [PATCH] fix(stage-tamagotchi): use electron cache path for updater cleanup --- .../src/main/services/electron/auto-updater.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/stage-tamagotchi/src/main/services/electron/auto-updater.ts b/apps/stage-tamagotchi/src/main/services/electron/auto-updater.ts index c82139e7a..603bfa754 100644 --- a/apps/stage-tamagotchi/src/main/services/electron/auto-updater.ts +++ b/apps/stage-tamagotchi/src/main/services/electron/auto-updater.ts @@ -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[0]) } const UPDATER_DEBUG_CACHE_DIR = join(getCacheRoot(), 'stage-tamagotchi-updater')