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

Function resolveBinary

packages/opencode/script/postinstall.mjs:119–124  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

117}
118
119function resolveBinary(name) {
120 const packageJsonPath = require.resolve(`${name}/package.json`)
121 const binaryPath = path.join(path.dirname(packageJsonPath), "bin", sourceBinary)
122 if (!fs.existsSync(binaryPath)) throw new Error(`Binary not found at ${binaryPath}`)
123 return binaryPath
124}
125
126function installPackage(name) {
127 const version = packageJson.optionalDependencies?.[name]

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected