From 032ed83fb4eda3f1fe9628393461f9f24c2c3581 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Sat, 30 Jul 2022 23:02:09 -0500 Subject: [PATCH] fix: set toolchain --- install.bash | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/install.bash b/install.bash index 4ab397e..216f5b2 100644 --- a/install.bash +++ b/install.bash @@ -100,9 +100,10 @@ install-rust() { if [[ -z "$(ls "${RUSTUP_HOME}/toolchains" >/dev/null)" ]]; then log "info" "No toolchain found, installing a ${GREEN}Rust${RESET_BOLD} toolchain" log "info" "Setting ${GREEN}Rust${RESET_BOLD}'s toolchain to ${GREEN}stable${RESET_BOLD}" - ( - printf "%s" "${install_path}/cargo/bin/rustup default stable" | zsh - ) + if ! rustup default stable; then + log "error" "Failed to set a ${GREEN}Rust${RESET_BOLD} toolchain" + return 1 + fi else log "info" "${GREEN}Rust${RESET_BOLD} toolchain found, skipping toolchain setup" fi