POSIX-compatible command-existence checking.

This commit is contained in:
Sage Vaillancourt 2021-10-06 19:16:02 -04:00
parent dfc6a780e9
commit 2d4801fbe0
1 changed files with 2 additions and 2 deletions

View File

@ -41,14 +41,14 @@ fi
# Install required packages
if [[ "$1" == "--install" ]]; then
echo -n "Rust is "
if ! where cargo; then
if ! command -v cargo; then
echo "not installed. Installing..."
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
else
echo "installed."
fi
. "$HOME/.cargo/env"
if where cargo; then
if command -v cargo; then
cargo install bat
fi
sh -c "$(curl -fsSL https://starship.rs/install.sh)"