()
| 67 | } |
| 68 | |
| 69 | export function migrate() { |
| 70 | if (getStore().get(TAURI_MIGRATED_KEY)) { |
| 71 | log.log("tauri migration: already done, skipping") |
| 72 | return |
| 73 | } |
| 74 | |
| 75 | const dir = tauriDir(tauriAppId()) |
| 76 | log.log("tauri migration: starting", { dir }) |
| 77 | |
| 78 | if (!existsSync(dir)) { |
| 79 | log.log("tauri migration: no tauri data directory found, nothing to migrate") |
| 80 | getStore().set(TAURI_MIGRATED_KEY, true) |
| 81 | return |
| 82 | } |
| 83 | |
| 84 | for (const filename of readdirSync(dir)) { |
| 85 | if (!filename.endsWith(".dat")) continue |
| 86 | migrateFile(join(dir, filename), filename) |
| 87 | } |
| 88 | |
| 89 | log.log("tauri migration: complete") |
| 90 | getStore().set(TAURI_MIGRATED_KEY, true) |
| 91 | } |
no test coverage detected