()
| 25 | ] |
| 26 | |
| 27 | function loadLastChoice() { |
| 28 | try { |
| 29 | const key = readFileSync(cacheFile, 'utf8').trim() |
| 30 | const idx = options.findIndex((o) => o.key === key) |
| 31 | return idx >= 0 ? idx : 0 |
| 32 | } catch { |
| 33 | return 0 |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | function saveChoice(key) { |
| 38 | try { |