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

Function copyBinary

packages/opencode/script/postinstall.mjs:146–156  ·  view source on GitHub ↗
(source, target)

Source from the content-addressed store, hash-verified

144}
145
146function copyBinary(source, target) {
147 if (!fs.existsSync(source)) throw new Error(`Binary not found at ${source}`)
148 fs.mkdirSync(path.dirname(target), { recursive: true })
149 if (fs.existsSync(target)) fs.unlinkSync(target)
150 try {
151 fs.linkSync(source, target)
152 } catch {
153 fs.copyFileSync(source, target)
154 }
155 fs.chmodSync(target, 0o755)
156}
157
158function verifyBinary() {
159 const result = childProcess.spawnSync(targetBinary, ["--version"], {

Callers 2

installPackageFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected