(path: string, content: string)
| 46 | } |
| 47 | |
| 48 | private async doWrite(path: string, content: string): Promise<void> { |
| 49 | try { |
| 50 | const abs = this.abs(path); |
| 51 | await mkdir(dirname(abs), { recursive: true }); |
| 52 | await writeFile(abs, content, "utf8"); |
| 53 | await this.appendVersion(path, content); |
| 54 | } catch (err) { |
| 55 | for (const h of this.errorHandlers) h({ error: { message: String(err), cause: err } }); |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | async flush(): Promise<void> { |
| 60 | // Promise.all rejects on the first write failure; per-write errors are also |
no test coverage detected