feat: handle missing toolchains

This commit is contained in:
Price Hiller 2022-07-30 22:36:41 -05:00
parent cb6f368c94
commit 0a9854e304

View File

@ -102,7 +102,13 @@ install-rust() {
fi
export PATH="${PATH}:${install_path}/cargo/bin"
rustup default stable
if [[ -z "$(ls "${RUSTUP_HOME}/toolchains")" ]]; 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}"
rustup default stable
else
log "info" "${GREEN}Rust${RESET_BOLD} toolchain found, skipping toolchain setup"
fi
}
install-cargo-binary() {