MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / restoreOptionalFile

Function restoreOptionalFile

scripts/smoke-claw-code-desktop.mjs:110–116  ·  view source on GitHub ↗
(filePath, snapshot)

Source from the content-addressed store, hash-verified

108}
109
110async function restoreOptionalFile(filePath, snapshot) {
111 if (snapshot === null) {
112 await rm(filePath, { force: true }).catch(() => {})
113 return
114 }
115 await writeFile(filePath, snapshot, 'utf8')
116}
117
118async function terminate(child) {
119 if (!child || child.exitCode !== null) {

Callers 1

mainFunction · 0.85

Calls 1

writeFileFunction · 0.85

Tested by

no test coverage detected