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
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@serve.zone/nupst",
|
"name": "@serve.zone/nupst",
|
||||||
"version": "5.0.4",
|
"version": "5.0.5",
|
||||||
"exports": "./mod.ts",
|
"exports": "./mod.ts",
|
||||||
"tasks": {
|
"tasks": {
|
||||||
"dev": "deno run --allow-all mod.ts",
|
"dev": "deno run --allow-all mod.ts",
|
||||||
|
11
install.sh
11
install.sh
@@ -216,9 +216,20 @@ fi
|
|||||||
BINARY_PATH="$INSTALL_DIR/nupst"
|
BINARY_PATH="$INSTALL_DIR/nupst"
|
||||||
mv "$TEMP_FILE" "$BINARY_PATH"
|
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
|
# Make executable
|
||||||
chmod +x "$BINARY_PATH"
|
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 "Binary installed successfully to: $BINARY_PATH"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user