Update tools.func

This commit is contained in:
CanbiZ 2025-05-27 13:45:53 +02:00
parent 0e6a4038e9
commit 13d64b2d0c

View File

@ -1205,9 +1205,9 @@ install_rust_and_crates() {
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >>"$HOME/.profile" echo 'export PATH="$HOME/.cargo/bin:$PATH"' >>"$HOME/.profile"
msg_ok "Installed rustup with $RUST_TOOLCHAIN" msg_ok "Installed rustup with $RUST_TOOLCHAIN"
else else
rustup install "$RUST_TOOLCHAIN" >/dev/null $STD rustup install "$RUST_TOOLCHAIN"
rustup default "$RUST_TOOLCHAIN" >/dev/null $STD rustup default "$RUST_TOOLCHAIN"
rustup update "$RUST_TOOLCHAIN" >/dev/null $STD rustup update "$RUST_TOOLCHAIN"
msg_ok "Rust toolchain set to $RUST_TOOLCHAIN" msg_ok "Rust toolchain set to $RUST_TOOLCHAIN"
fi fi
@ -1229,16 +1229,16 @@ install_rust_and_crates() {
if [[ -n "$INSTALLED_VER" ]]; then if [[ -n "$INSTALLED_VER" ]]; then
if [[ -n "$VER" && "$VER" != "$INSTALLED_VER" ]]; then if [[ -n "$VER" && "$VER" != "$INSTALLED_VER" ]]; then
msg_info "Updating $NAME from $INSTALLED_VER to $VER" msg_info "Updating $NAME from $INSTALLED_VER to $VER"
cargo install "$NAME" --version "$VER" --force $STD cargo install "$NAME" --version "$VER" --force
elif [[ -z "$VER" ]]; then elif [[ -z "$VER" ]]; then
msg_info "Updating $NAME to latest" msg_info "Updating $NAME to latest"
cargo install "$NAME" --force $STD cargo install "$NAME" --force
else else
msg_ok "$NAME@$INSTALLED_VER already up to date" msg_ok "$NAME@$INSTALLED_VER already up to date"
fi fi
else else
msg_info "Installing $NAME ${VER:+($VER)}" msg_info "Installing $NAME ${VER:+($VER)}"
cargo install "$NAME" ${VER:+--version "$VER"} $STD cargo install "$NAME" ${VER:+--version "$VER"}
fi fi
done done
msg_ok "All requested Rust crates processed" msg_ok "All requested Rust crates processed"