(file: string, s: Stored)
| 39 | }; |
| 40 | } |
| 41 | function writeState(file: string, s: Stored) { |
| 42 | try { |
| 43 | fs.mkdirSync(path.dirname(file), { recursive: true }); |
| 44 | fs.writeFileSync(file, JSON.stringify(s)); |
| 45 | } catch { |
| 46 | /* read-only fs / CI: best-effort */ |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | /** Thrown by command funnels so the index wrapper can attribute the failure stage + drain once. */ |
| 51 | export class CreateError extends Error { |