(loc: Location)
| 135 | } |
| 136 | |
| 137 | detect(loc: Location): DetectionResult { |
| 138 | const file = configPath(loc); |
| 139 | const config = parseConfig(readConfigText(file)); |
| 140 | const alreadyConfigured = !!config.mcp?.codegraph; |
| 141 | // Global: the XDG dir is what current opencode creates on first run; the |
| 142 | // legacy %APPDATA% dir still counts as "opencode present" so a re-install |
| 143 | // can sweep the stale pre-#535 entry out of it. |
| 144 | const legacy = legacyWindowsConfigDir(); |
| 145 | const installed = loc === 'global' |
| 146 | ? fs.existsSync(globalConfigDir()) || (!!legacy && fs.existsSync(legacy)) |
| 147 | : fs.existsSync(file); |
| 148 | return { installed, alreadyConfigured, configPath: file }; |
| 149 | } |
| 150 | |
| 151 | install(loc: Location, _opts: InstallOptions): WriteResult { |
| 152 | const files: WriteResult['files'] = []; |
nothing calls this directly
no test coverage detected