MCPcopy Index your code
hub / github.com/anomalyco/opencode / resolveBin

Function resolveBin

packages/opencode/src/lsp/server.ts:242–256  ·  view source on GitHub ↗
(target: string)

Source from the content-addressed store, hash-verified

240 const lintTarget = path.join("node_modules", ".bin", "oxlint" + ext)
241
242 const resolveBin = async (target: string) => {
243 const localBin = path.join(root, target)
244 if (await Filesystem.exists(localBin)) return localBin
245
246 const candidates = Filesystem.up({
247 targets: [target],
248 start: root,
249 stop: ctx.worktree,
250 })
251 const first = await candidates.next()
252 await candidates.return()
253 if (first.value) return first.value
254
255 return undefined
256 }
257
258 let lintBin = await resolveBin(lintTarget)
259 if (!lintBin) {

Callers 1

spawnFunction · 0.85

Calls 2

existsMethod · 0.45
nextMethod · 0.45

Tested by

no test coverage detected