Skip to content

Commit 7b51f45

Browse files
engineerCopilot
authored andcommitted
fix: rename bin/opencode to bin/opencode.cjs and add dist binary lookup
- Add explicit .cjs extension to clarify CommonJS module format - Update package.json bin entry to match new filename - Add dist/<platform-arch>/bin/<binary> fallback for local builds Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 4fcb3ee commit 7b51f45

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@ if (!arch) {
5353
const base = "opencode-" + platform + "-" + arch
5454
const binary = platform === "windows" ? "opencode.exe" : "opencode"
5555

56+
const distBinary = path.join(scriptDir, "..", "dist", base, "bin", binary)
57+
if (fs.existsSync(distBinary)) {
58+
run(distBinary)
59+
}
60+
5661
function supportsAvx2() {
5762
if (arch !== "x64") return false
5863

‎packages/opencode/package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"db": "bun drizzle-kit"
2929
},
3030
"bin": {
31-
"opencode": "./bin/opencode"
31+
"opencode": "./bin/opencode.cjs"
3232
},
3333
"randomField": "this-is-a-random-value-12345",
3434
"exports": {

0 commit comments

Comments
 (0)