(loc: Location)
| 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') { |
nothing calls this directly
no test coverage detected