MCPcopy
hub / github.com/codeaashu/claude-code / writeBridgePointer

Function writeBridgePointer

src/bridge/bridgePointer.ts:62–74  ·  view source on GitHub ↗
(
  dir: string,
  pointer: BridgePointer,
)

Source from the content-addressed store, hash-verified

60 * itself cause a crash. Logs and swallows on error.
61 */
62export async function writeBridgePointer(
63 dir: string,
64 pointer: BridgePointer,
65): Promise<void> {
66 const path = getBridgePointerPath(dir)
67 try {
68 await mkdir(dirname(path), { recursive: true })
69 await writeFile(path, jsonStringify(pointer), 'utf8')
70 logForDebugging(`[bridge:pointer] wrote ${path}`)
71 } catch (err: unknown) {
72 logForDebugging(`[bridge:pointer] write failed: ${err}`, { level: 'warn' })
73 }
74}
75
76/**
77 * Read the pointer and its age (ms since last write). Operates directly

Callers 3

initBridgeCoreFunction · 0.85
doReconnectFunction · 0.85
bridgeMainFunction · 0.85

Calls 4

getBridgePointerPathFunction · 0.85
mkdirFunction · 0.85
jsonStringifyFunction · 0.85
logForDebuggingFunction · 0.85

Tested by

no test coverage detected