(cache: UpdateCache)
| 46 | } |
| 47 | |
| 48 | function writeCache(cache: UpdateCache): void { |
| 49 | try { |
| 50 | const dir = path.dirname(CACHE_FILE) |
| 51 | if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true }) |
| 52 | fs.writeFileSync(CACHE_FILE, JSON.stringify(cache), 'utf-8') |
| 53 | } catch { |
| 54 | // non-critical |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | function isNewerVersion(latest: string, current: string): boolean { |
| 59 | const parse = (v: string) => { |
no outgoing calls
no test coverage detected