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

Function writeHermesConfig

src/installer/targets/hermes.ts:123–135  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

121}
122
123function writeHermesConfig(): WriteResult['files'][number] {
124 const file = configPath();
125 const existed = fs.existsSync(file);
126 const before = readText(file);
127 const afterMcp = upsertCodeGraphMcpServer(before);
128 const after = upsertCodeGraphToolset(afterMcp);
129
130 if (after === before) {
131 return { path: file, action: 'unchanged' };
132 }
133 atomicWriteFileSync(file, ensureTrailingNewline(after));
134 return { path: file, action: existed ? 'updated' : 'created' };
135}
136
137function ensureTrailingNewline(text: string): string {
138 return text.endsWith('\n') ? text : text + '\n';

Callers 1

installMethod · 0.85

Calls 6

atomicWriteFileSyncFunction · 0.90
readTextFunction · 0.85
upsertCodeGraphMcpServerFunction · 0.85
upsertCodeGraphToolsetFunction · 0.85
configPathFunction · 0.70
ensureTrailingNewlineFunction · 0.70

Tested by

no test coverage detected