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

Method uninstall

src/installer/targets/codex.ts:95–120  ·  view source on GitHub ↗
(loc: Location)

Source from the content-addressed store, hash-verified

93 }
94
95 uninstall(loc: Location): WriteResult {
96 if (loc !== 'global') return { files: [] };
97 const files: WriteResult['files'] = [];
98
99 const tomlPath = tomlConfigPath();
100 if (fs.existsSync(tomlPath)) {
101 const content = fs.readFileSync(tomlPath, 'utf-8');
102 const { content: nextContent, action } = removeTomlTable(content, TOML_HEADER);
103 if (action === 'removed') {
104 if (nextContent.trim() === '') {
105 try { fs.unlinkSync(tomlPath); } catch { /* ignore */ }
106 } else {
107 atomicWriteFileSync(tomlPath, nextContent.trimEnd() + '\n');
108 }
109 files.push({ path: tomlPath, action: 'removed' });
110 } else {
111 files.push({ path: tomlPath, action: 'not-found' });
112 }
113 } else {
114 files.push({ path: tomlPath, action: 'not-found' });
115 }
116
117 files.push(removeInstructionsEntry());
118
119 return { files };
120 }
121
122 printConfig(loc: Location): string {
123 if (loc !== 'global') {

Callers

nothing calls this directly

Calls 4

removeTomlTableFunction · 0.90
atomicWriteFileSyncFunction · 0.90
tomlConfigPathFunction · 0.85
removeInstructionsEntryFunction · 0.70

Tested by

no test coverage detected