| 11 | // Resolve the directory where Tauri stored its .dat files for the given app identifier. |
| 12 | // Mirrors Tauri's AppLocalData / AppData resolution per OS. |
| 13 | function tauriDir(id: string) { |
| 14 | switch (process.platform) { |
| 15 | case "darwin": |
| 16 | return join(homedir(), "Library", "Application Support", id) |
| 17 | case "win32": |
| 18 | return join(process.env.APPDATA ?? join(homedir(), "AppData", "Roaming"), id) |
| 19 | default: |
| 20 | return join(process.env.XDG_DATA_HOME ?? join(homedir(), ".local", "share"), id) |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | // The Tauri app identifier changes between dev/beta/prod builds. |
| 25 | const TAURI_APP_IDS: Record<string, string> = { |