MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / removeFileUnlessLinked

Function removeFileUnlessLinked

src/installer/targets/shared.ts:198–204  ·  view source on GitHub ↗
(filePath: string, emptied: string)

Source from the content-addressed store, hash-verified

196 * (#2721).
197 */
198export function removeFileUnlessLinked(filePath: string, emptied: string): void {
199 if (isSymbolicLink(filePath)) {
200 atomicWriteFileSync(filePath, emptied);
201 return;
202 }
203 try { fs.unlinkSync(filePath); } catch { /* ignore */ }
204}
205
206/**
207 * Copy a file we're about to overwrite to `<path>.backup` when it isn't

Callers 6

removeCodegraphServerFunction · 0.90
cleanupLegacyLocalMcpFunction · 0.90
uninstallMethod · 0.90
removeFromPatchFunction · 0.90
deleteTomlTableFunction · 0.90
removeMarkedSectionFunction · 0.85

Calls 2

isSymbolicLinkFunction · 0.85
atomicWriteFileSyncFunction · 0.85

Tested by

no test coverage detected