(latest: string | null)
| 89 | } |
| 90 | |
| 91 | function writeCache(latest: string | null): void { |
| 92 | try { |
| 93 | const dir = getConfigDir(); |
| 94 | fs.mkdirSync(dir, { recursive: true }); |
| 95 | fs.writeFileSync( |
| 96 | getCachePath(), |
| 97 | JSON.stringify({ checkedAt: Date.now(), latest } satisfies CachedCheck), |
| 98 | { mode: 0o600 }, |
| 99 | ); |
| 100 | } catch { |
| 101 | // best-effort; a missing cache just means we'll hit the registry again next launch |
| 102 | } |
| 103 | } |
| 104 | |
| 105 | export interface UpdateInfo { |
| 106 | current: string; |
no test coverage detected