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

Function removeCodegraphFromFile

src/installer/targets/antigravity.ts:287–299  ·  view source on GitHub ↗
(file: string)

Source from the content-addressed store, hash-verified

285}
286
287function removeCodegraphFromFile(file: string): WriteResult['files'][number] {
288 if (!fs.existsSync(file)) return { path: file, action: 'not-found' };
289 const config = readJsonFile(file);
290 if (!config.mcpServers?.codegraph) return { path: file, action: 'not-found' };
291 delete config.mcpServers.codegraph;
292 if (Object.keys(config.mcpServers).length === 0) {
293 delete config.mcpServers;
294 }
295 // Leave a now-empty `{}` in place — Antigravity manages this file and
296 // a stray empty file is less surprising than a deletion.
297 writeJsonFile(file, config);
298 return { path: file, action: 'removed' };
299}
300
301export const antigravityTarget: AgentTarget = new AntigravityTarget();

Callers 1

uninstallMethod · 0.85

Calls 2

readJsonFileFunction · 0.90
writeJsonFileFunction · 0.90

Tested by

no test coverage detected