Resolve a runnable `opencode` CLI binary, or null.
(d: DetectDeps)
| 94 | |
| 95 | /** Resolve a runnable `opencode` CLI binary, or null. */ |
| 96 | function resolveCliBinary(d: DetectDeps): string | null { |
| 97 | const stockBin = stockCliBinary(d); |
| 98 | if (d.exists(stockBin)) return stockBin; |
| 99 | const onPath = d.onPath("opencode"); |
| 100 | if (onPath) return onPath; |
| 101 | for (const candidate of extraCliCandidates(d)) { |
| 102 | if (d.exists(candidate)) return candidate; |
| 103 | } |
| 104 | return null; |
| 105 | } |
| 106 | |
| 107 | /** XDG-aware config base used for the Linux Desktop userData location. */ |
| 108 | function xdgConfigHome(d: DetectDeps): string { |
no test coverage detected