MCPcopy Create free account
hub / github.com/dyoshikawa/rulesync / writeIfNotExists

Function writeIfNotExists

src/lib/init.ts:284–291  ·  view source on GitHub ↗
(path: string, content: string)

Source from the content-addressed store, hash-verified

282}
283
284async function writeIfNotExists(path: string, content: string): Promise<InitFileResult> {
285 if (await fileExists(path)) {
286 return { created: false, path };
287 }
288
289 await writeFileContent(path, content);
290 return { created: true, path };
291}

Callers 1

createSampleFilesFunction · 0.85

Calls 2

fileExistsFunction · 0.85
writeFileContentFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…