MCPcopy Create free account
hub / github.com/anomalyco/opencode / findBinary

Function findBinary

packages/cli/bin/lildax.cjs:106–119  ·  view source on GitHub ↗
(startDir)

Source from the content-addressed store, hash-verified

104})()
105
106function findBinary(startDir) {
107 let current = startDir
108 for (;;) {
109 const modules = path.join(current, "node_modules")
110 if (fs.existsSync(modules))
111 for (const name of names) {
112 const candidate = path.join(modules, name, "bin", binary)
113 if (fs.existsSync(candidate)) return candidate
114 }
115 const parent = path.dirname(current)
116 if (parent === current) return
117 current = parent
118 }
119}
120
121const resolved = envPath || (fs.existsSync(cached) ? cached : findBinary(scriptDir))
122if (!resolved) {

Callers 1

lildax.cjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected