MCPcopy Create free account
hub / github.com/HELPMEEADICE/doge-code / appendEntryToFile

Function appendEntryToFile

src/utils/sessionStorage.ts:2618–2630  ·  view source on GitHub ↗
(
  fullPath: string,
  entry: Record<string, unknown>,
)

Source from the content-addressed store, hash-verified

2616 */
2617/* eslint-disable custom-rules/no-sync-fs -- sync callers (exit cleanup, materialize) */
2618function appendEntryToFile(
2619 fullPath: string,
2620 entry: Record<string, unknown>,
2621): void {
2622 const fs = getFsImplementation()
2623 const line = jsonStringify(entry) + '\n'
2624 try {
2625 fs.appendFileSync(fullPath, line, { mode: 0o600 })
2626 } catch {
2627 fs.mkdirSync(dirname(fullPath), { mode: 0o700 })
2628 fs.appendFileSync(fullPath, line, { mode: 0o600 })
2629 }
2630}
2631
2632/**
2633 * Sync tail read for reAppendSessionMetadata's external-writer check.

Callers 9

saveCustomTitleFunction · 0.85
saveAiGeneratedTitleFunction · 0.85
saveTaskSummaryFunction · 0.85
saveTagFunction · 0.85
linkSessionToPRFunction · 0.85
saveAgentNameFunction · 0.85
saveAgentColorFunction · 0.85
saveWorktreeStateFunction · 0.85

Calls 2

getFsImplementationFunction · 0.85
jsonStringifyFunction · 0.85

Tested by

no test coverage detected