diff --git a/install.sh b/install.sh index 5baf1db..5302c68 100755 --- a/install.sh +++ b/install.sh @@ -31,12 +31,26 @@ echo "[ok] jq found" # ── Build release binary ───────────────────────────────────────────── echo "" echo "Building release binary..." -(cd "$SCRIPT_DIR" && cargo build --release --quiet) -echo "[ok] Built: $(ls -lh "$SCRIPT_DIR/target/release/$BINARY_NAME" | awk '{print $5}')" +if ! (cd "$SCRIPT_DIR" && cargo build --release); then + echo "" + echo "ERROR: cargo build failed. Check the output above for details." + echo " Common causes:" + echo " - Missing C compiler: sudo apt install build-essential (Debian/Ubuntu)" + echo " - Missing libc headers: sudo apt install libc6-dev" + exit 1 +fi + +BINARY="$SCRIPT_DIR/target/release/$BINARY_NAME" +if [[ ! -f "$BINARY" ]]; then + echo "ERROR: Build succeeded but binary not found at $BINARY" + echo " Check: ls $SCRIPT_DIR/target/release/" + exit 1 +fi +echo "[ok] Built: $(ls -lh "$BINARY" | awk '{print $5}')" # ── Install binary ─────────────────────────────────────────────────── mkdir -p "$INSTALL_DIR" -cp "$SCRIPT_DIR/target/release/$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME" +cp "$BINARY" "$INSTALL_DIR/$BINARY_NAME" chmod +x "$INSTALL_DIR/$BINARY_NAME" echo "[ok] Installed to $INSTALL_DIR/$BINARY_NAME"