MCPcopy Index your code
hub / github.com/liuup/claude-code-analysis / appendEntryToFile

Function appendEntryToFile

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

Source from the content-addressed store, hash-verified

2570 */
2571/* eslint-disable custom-rules/no-sync-fs -- sync callers (exit cleanup, materialize) */
2572function appendEntryToFile(
2573 fullPath: string,
2574 entry: Record<string, unknown>,
2575): void {
2576 const fs = getFsImplementation()
2577 const line = jsonStringify(entry) + '\n'
2578 try {
2579 fs.appendFileSync(fullPath, line, { mode: 0o600 })
2580 } catch {
2581 fs.mkdirSync(dirname(fullPath), { mode: 0o700 })
2582 fs.appendFileSync(fullPath, line, { mode: 0o600 })
2583 }
2584}
2585
2586/**
2587 * 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