POSIX-compatible command-existence checking.
This commit is contained in:
parent
dfc6a780e9
commit
2d4801fbe0
4
copy.sh
4
copy.sh
|
@ -41,14 +41,14 @@ fi
|
||||||
# Install required packages
|
# Install required packages
|
||||||
if [[ "$1" == "--install" ]]; then
|
if [[ "$1" == "--install" ]]; then
|
||||||
echo -n "Rust is "
|
echo -n "Rust is "
|
||||||
if ! where cargo; then
|
if ! command -v cargo; then
|
||||||
echo "not installed. Installing..."
|
echo "not installed. Installing..."
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
else
|
else
|
||||||
echo "installed."
|
echo "installed."
|
||||||
fi
|
fi
|
||||||
. "$HOME/.cargo/env"
|
. "$HOME/.cargo/env"
|
||||||
if where cargo; then
|
if command -v cargo; then
|
||||||
cargo install bat
|
cargo install bat
|
||||||
fi
|
fi
|
||||||
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
|
sh -c "$(curl -fsSL https://starship.rs/install.sh)"
|
||||||
|
|
Loading…
Reference in New Issue