MCPcopy Create free account
hub / github.com/cortexkit/magic-context / resolveCliBinary

Function resolveCliBinary

packages/cli/src/lib/opencode-detect.ts:96–105  ·  view source on GitHub ↗

Resolve a runnable `opencode` CLI binary, or null.

(d: DetectDeps)

Source from the content-addressed store, hash-verified

94
95/** Resolve a runnable `opencode` CLI binary, or null. */
96function 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. */
108function xdgConfigHome(d: DetectDeps): string {

Callers 1

detectOpenCodeFunction · 0.85

Calls 2

stockCliBinaryFunction · 0.85
extraCliCandidatesFunction · 0.85

Tested by

no test coverage detected