From 18bd9f6cdab6cbc079b565418b2f4b4d5a241011 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Mon, 20 Oct 2025 13:33:00 +0000 Subject: [PATCH] fix(install): add error checking for binary move and chmod operations - Check if mv command succeeds - Verify binary exists after move - Check if chmod succeeds - Exit with error instead of continuing on failure --- deno.json | 2 +- install.sh | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/deno.json b/deno.json index 1cd949d..0247afd 100644 --- a/deno.json +++ b/deno.json @@ -1,6 +1,6 @@ { "name": "@serve.zone/nupst", - "version": "5.0.4", + "version": "5.0.5", "exports": "./mod.ts", "tasks": { "dev": "deno run --allow-all mod.ts", diff --git a/install.sh b/install.sh index 34d0979..b59699c 100644 --- a/install.sh +++ b/install.sh @@ -216,9 +216,20 @@ fi BINARY_PATH="$INSTALL_DIR/nupst" mv "$TEMP_FILE" "$BINARY_PATH" +if [ $? -ne 0 ] || [ ! -f "$BINARY_PATH" ]; then + echo "Error: Failed to move binary to $BINARY_PATH" + rm -f "$TEMP_FILE" 2>/dev/null + exit 1 +fi + # Make executable chmod +x "$BINARY_PATH" +if [ $? -ne 0 ]; then + echo "Error: Failed to make binary executable" + exit 1 +fi + echo "Binary installed successfully to: $BINARY_PATH" echo ""