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

Function main

packages/opencode/script/postinstall.mjs:167–182  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

165}
166
167function main() {
168 for (const name of packageNames()) {
169 try {
170 copyBinary(resolveBinary(name), targetBinary)
171 if (verifyBinary()) return
172 } catch {
173 if (installPackage(name) && verifyBinary()) return
174 }
175 }
176
177 throw new Error(
178 `It seems your package manager failed to install the right opencode CLI package. Try manually installing ${packageNames()
179 .map((name) => JSON.stringify(name))
180 .join(" or ")}.`,
181 )
182}
183
184try {
185 main()

Callers 2

postinstall.mjsFile · 0.70

Calls 5

packageNamesFunction · 0.85
copyBinaryFunction · 0.85
resolveBinaryFunction · 0.85
verifyBinaryFunction · 0.85
installPackageFunction · 0.85

Tested by

no test coverage detected