Don't show warning if $CARGO_HOME/bin is in $PATH (#1239)

This commit is contained in:
Asger Hautop Drewsen 2023-08-02 13:34:43 +02:00 committed by GitHub
parent 855ca88477
commit 7c2ddd9a0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,8 +27,11 @@ fi
./cargo-binstall -y --force cargo-binstall
if ! [[ ":$PATH:" == *":$HOME/.cargo/bin:"* ]]; then
if ! [[ $CARGO_HOME ]]; then
CARGO_HOME=$HOME/.cargo
fi
if ! [[ ":$PATH:" == *":$CARGO_HOME/bin:"* ]]; then
echo
printf "\033[0;31mYour path is missing ~/.cargo/bin, you might want to add it.\033[0m\n"
printf "\033[0;31mYour path is missing %s, you might want to add it.\033[0m\n" "$CARGO_HOME/bin"
echo
fi