Skip to content

Commit

Permalink
fix: Add validation for missing argument in install_cargo_binary
Browse files Browse the repository at this point in the history
  • Loading branch information
ursulabauer authored Dec 22, 2024
1 parent ac6b6d0 commit 76ae56b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/setup-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,18 @@ function install_rustup {
}

function install_cargo_binary {
if [ -z "$1" ]; then
echo "Error: Crate name is required."
return 1
fi

CRATE_NAME=$1
BIN_NAME=${2:-$1}

if command -v "$BIN_NAME" &> /dev/null; then
echo "$CRATE_NAME is already installed"
else
cargo install "$CRATE_NAME" --force --locked
cargo install "$CRATE_NAME" --locked
fi
}

Expand Down

0 comments on commit 76ae56b

Please sign in to comment.