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

Function removeFileUnlessLinked

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

Source from the content-addressed store, hash-verified

195 * (#2721).
196 */
197export function removeFileUnlessLinked(filePath: string, emptied: string): void {
198 if (isSymbolicLink(filePath)) {
199 atomicWriteFileSync(filePath, emptied);
200 return;
201 }
202 try { fs.unlinkSync(filePath); } catch { /* ignore */ }
203}
204
205/**
206 * 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