(path: string, diff: string)
| 23 | } |
| 24 | |
| 25 | export async function updatePatchedFile(path: string, diff: string): Promise<void> { |
| 26 | const content = await fs.readFile(path, 'utf8'); |
| 27 | const updated = patchContent(content, diff); |
| 28 | if (updated !== content) await fs.writeFile(path, updated, 'utf8'); |
| 29 | } |
| 30 | |
| 31 | function patchContent(content: string, diff: string, mode?: 'create'): string { |
| 32 | try { |
no test coverage detected