jerecom commited on
Commit
11de2d2
·
verified ·
1 Parent(s): b812225

Use find to locate opencode binary

Browse files
Files changed (1) hide show
  1. 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
- mv "$tmp_dir/opencode-linux-x64/opencode" "$INSTALL_DIR"
 
 
 
 
 
 
 
 
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