Skip to content

Commit fb11ab8

Browse files
committed
fix launcher to find opencode-dev binary
1 parent ef90750 commit fb11ab8

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ download_and_install() {
307307
unzip -q "$tmp_dir/$filename" -d "$tmp_dir"
308308
fi
309309

310-
mv "$tmp_dir/bin/opencode" "$INSTALL_DIR"
310+
mv "$tmp_dir/bin/opencode-dev" "$INSTALL_DIR/opencode"
311311
chmod 755 "${INSTALL_DIR}/opencode"
312312
rm -rf "$tmp_dir"
313313
}

packages/opencode/bin/opencode

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ if (!arch) {
5050
arch = os.arch()
5151
}
5252
const base = "opencode-" + platform + "-" + arch
53-
const binaryName = process.env.OPENCODE_DEV_BIN || "opencode"
53+
const binaryName = process.env.OPENCODE_DEV_BIN || "opencode-dev"
5454
const binary = platform === "windows" ? binaryName + ".exe" : binaryName
5555

5656
const names = (() => {
@@ -82,11 +82,16 @@ const names = (() => {
8282
})()
8383

8484
function findBinary(startDir) {
85-
const localBinary = path.join(scriptDir, "bin", binary)
85+
const localBinary = path.join(scriptDir, binary)
8686
if (fs.existsSync(localBinary)) {
8787
return localBinary
8888
}
8989

90+
const localBinDir = path.join(scriptDir, "bin", binary)
91+
if (fs.existsSync(localBinDir)) {
92+
return localBinDir
93+
}
94+
9095
let current = startDir
9196
for (;;) {
9297
const modules = path.join(current, "node_modules")

0 commit comments

Comments
 (0)