(loc: Location)
| 159 | } |
| 160 | |
| 161 | detect(loc: Location): DetectionResult { |
| 162 | const file = configPath(loc); |
| 163 | const config = parseConfig(readConfigText(file)); |
| 164 | const alreadyConfigured = hasCodegraphEntry(config); |
| 165 | // Global: the XDG dir is what current opencode creates on first run; the |
| 166 | // legacy %APPDATA% dir still counts as "opencode present" so a re-install |
| 167 | // can sweep the stale pre-#535 entry out of it. |
| 168 | const legacy = legacyWindowsConfigDir(); |
| 169 | const installed = loc === 'global' |
| 170 | ? fs.existsSync(globalConfigDir()) || (!!legacy && fs.existsSync(legacy)) |
| 171 | : fs.existsSync(file); |
| 172 | return { installed, alreadyConfigured, configPath: file }; |
| 173 | } |
| 174 | |
| 175 | install(loc: Location, _opts: InstallOptions): WriteResult { |
| 176 | const files: WriteResult['files'] = []; |
nothing calls this directly
no test coverage detected