MCPcopy Create free account
hub / github.com/apache/maka / updatePatchedFile

Function updatePatchedFile

packages/runtime/src/apply-patch-file.ts:25–29  ·  view source on GitHub ↗
(path: string, diff: string)

Source from the content-addressed store, hash-verified

23}
24
25export 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
31function patchContent(content: string, diff: string, mode?: 'create'): string {
32 try {

Callers 2

applyPatchMethod · 0.85

Calls 3

patchContentFunction · 0.85
readFileMethod · 0.65
writeFileMethod · 0.65

Tested by

no test coverage detected