MCPcopy Create free account
hub / github.com/Noumena-Network/code / writeFileForSync

Function writeFileForSync

src/services/settingsSync/index.ts:458–475  ·  view source on GitHub ↗
(
  filePath: string,
  content: string,
)

Source from the content-addressed store, hash-verified

456}
457
458async function writeFileForSync(
459 filePath: string,
460 content: string,
461): Promise<boolean> {
462 try {
463 const parentDir = dirname(filePath)
464 if (parentDir) {
465 await mkdir(parentDir, { recursive: true })
466 }
467
468 await writeFile(filePath, content, 'utf8')
469 logForDiagnosticsNoPII('info', 'settings_sync_file_written')
470 return true
471 } catch {
472 logForDiagnosticsNoPII('warn', 'settings_sync_file_write_failed')
473 return false
474 }
475}
476
477/**
478 * Apply remote entries to local files (CCR pull pattern).

Callers 1

Calls 2

mkdirFunction · 0.85
logForDiagnosticsNoPIIFunction · 0.85

Tested by

no test coverage detected