(loc: Location)
| 58 | } |
| 59 | |
| 60 | detect(loc: Location): DetectionResult { |
| 61 | if (loc !== 'global') { |
| 62 | return { installed: false, alreadyConfigured: false }; |
| 63 | } |
| 64 | const tomlPath = tomlConfigPath(); |
| 65 | let alreadyConfigured = false; |
| 66 | if (fs.existsSync(tomlPath)) { |
| 67 | try { |
| 68 | const content = fs.readFileSync(tomlPath, 'utf-8'); |
| 69 | alreadyConfigured = content.includes(`[${TOML_HEADER}]`); |
| 70 | } catch { /* ignore */ } |
| 71 | } |
| 72 | const installed = fs.existsSync(configDir()); |
| 73 | return { installed, alreadyConfigured, configPath: tomlPath }; |
| 74 | } |
| 75 | |
| 76 | install(loc: Location, _opts: InstallOptions): WriteResult { |
| 77 | if (loc !== 'global') { |
nothing calls this directly
no test coverage detected