Use find to locate opencode binary
Browse files- install.sh +9 -1
install.sh
CHANGED
|
@@ -331,7 +331,15 @@ download_and_install() {
|
|
| 331 |
|
| 332 |
if [ "$os" = "linux" ]; then
|
| 333 |
tar -xzf "$tmp_dir/$filename" -C "$tmp_dir"
|
| 334 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 335 |
else
|
| 336 |
unzip -q "$tmp_dir/$filename" -d "$tmp_dir"
|
| 337 |
fi
|
|
|
|
| 331 |
|
| 332 |
if [ "$os" = "linux" ]; then
|
| 333 |
tar -xzf "$tmp_dir/$filename" -C "$tmp_dir"
|
| 334 |
+
# Find and move the opencode binary
|
| 335 |
+
OPENCODE_BIN=$(find "$tmp_dir" -name opencode -type f -printf '%h' 2>/dev/null | head -1)
|
| 336 |
+
if [ -n "$OPENCODE_BIN" ]; then
|
| 337 |
+
mv "$OPENCODE_BIN/opencode" "$INSTALL_DIR"
|
| 338 |
+
else
|
| 339 |
+
echo -e "${RED}Error: opencode binary not found${NC}"
|
| 340 |
+
ls -la "$tmp_dir"
|
| 341 |
+
exit 1
|
| 342 |
+
fi
|
| 343 |
else
|
| 344 |
unzip -q "$tmp_dir/$filename" -d "$tmp_dir"
|
| 345 |
fi
|