MCPcopy Index your code
hub / github.com/github/copilot-sdk / writeFileIfDifferent

Function writeFileIfDifferent

test/harness/replayingCapiProxy.ts:1490–1499  ·  view source on GitHub ↗
(filePath: string, contents: string)

Source from the content-addressed store, hash-verified

1488}
1489
1490async function writeFileIfDifferent(filePath: string, contents: string) {
1491 if (existsSync(filePath)) {
1492 const existingContents = await readFile(filePath, "utf-8");
1493 if (existingContents === contents) {
1494 return;
1495 }
1496 }
1497
1498 await writeFile(filePath, contents, "utf-8");
1499}
1500
1501function excludeFailedResponses(exchange: CapturedExchange): boolean {
1502 const status = exchange.response?.statusCode;

Callers 1

writeCapturesToDiskFunction · 0.85

Calls 2

readFileFunction · 0.50
writeFileFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…