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

Function atomicWriteFileSync

src/installer/targets/shared.ts:118–130  ·  view source on GitHub ↗
(filePath: string, content: string)

Source from the content-addressed store, hash-verified

116 * changes.
117 */
118export function atomicWriteFileSync(filePath: string, content: string): void {
119 if (!isSymbolicLink(filePath)) {
120 writeThenRename(filePath, content, true);
121 return;
122 }
123 let target = filePath;
124 try {
125 target = linkTarget(filePath);
126 writeThenRename(target, content, false);
127 } catch (err) {
128 throw linkWriteError(filePath, target, err);
129 }
130}
131
132function writeThenRename(filePath: string, content: string, createFolder: boolean): void {
133 const dir = path.dirname(filePath);

Callers 15

upsertCodegraphServerFunction · 0.90
removeCodegraphServerFunction · 0.90
uninstallMethod · 0.90
writeHermesConfigFunction · 0.90
writeMcpEntryFunction · 0.90
removeMcpEntryAtFunction · 0.90
writePatchFunction · 0.90
removeFromPatchFunction · 0.90
writeMcpEntryFunction · 0.90
removeMcpEntryFunction · 0.90
writeMcpEntryFunction · 0.90
removeMcpEntryFunction · 0.90

Calls 4

isSymbolicLinkFunction · 0.85
writeThenRenameFunction · 0.85
linkTargetFunction · 0.85
linkWriteErrorFunction · 0.85

Tested by

no test coverage detected