fix: handle rust toolchain
This commit is contained in:
parent
3f8530dfb8
commit
9eec3451c6
23
install.bash
23
install.bash
@ -96,21 +96,22 @@ install-rust() {
|
|||||||
export RUSTUP_HOME="${install_path}/rustup"
|
export RUSTUP_HOME="${install_path}/rustup"
|
||||||
|
|
||||||
if ! [[ -e "${CARGO_HOME}" ]] || ! [[ -e "${RUSTUP_HOME}" ]]; then
|
if ! [[ -e "${CARGO_HOME}" ]] || ! [[ -e "${RUSTUP_HOME}" ]]; then
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | ${RUSTUP_HOME} sh -s -- -y --quiet
|
log "info" "Rust installs set to ${GREEN}cargo${RESET_BOLD}: ${GREEN}${CARGO_HOME}${RESET_BOLD} & ${GREEN}rustup${RESET_BOLD} ${GREEN}${RUSTUP_HOME}${RESET_BOLD}"
|
||||||
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --quiet
|
||||||
|
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
|
||||||
|
)
|
||||||
|
else
|
||||||
|
log "info" "${GREEN}Rust${RESET_BOLD} toolchain found, skipping toolchain setup"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
log "info" "${GREEN}Rust${RESET_BOLD} already installed, skipping"
|
log "info" "${GREEN}Rust${RESET_BOLD} already installed, skipping"
|
||||||
fi
|
fi
|
||||||
export PATH="${PATH}:${install_path}/cargo/bin"
|
export PATH="${PATH}:${install_path}/cargo/bin"
|
||||||
|
|
||||||
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}"
|
|
||||||
(
|
|
||||||
printf "%s" "rustup default stable" | zsh
|
|
||||||
)
|
|
||||||
else
|
|
||||||
log "info" "${GREEN}Rust${RESET_BOLD} toolchain found, skipping toolchain setup"
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
install-cargo-binary() {
|
install-cargo-binary() {
|
||||||
@ -179,7 +180,7 @@ deploy-config() {
|
|||||||
main() {
|
main() {
|
||||||
local tasks_done=()
|
local tasks_done=()
|
||||||
PKG_INSTALL_CMD="${*}"
|
PKG_INSTALL_CMD="${*}"
|
||||||
if [[ -z "${PKG_INSTALL_CMD}" ]]; then
|
if [[ -z "${PKG_INSTALL_CMD}" ]] && ! [[ "${SKIP_PKG_INSTALL}" = true ]]; then
|
||||||
log "error" "A package installer must be passed to install missing packages, or ${GREEN}SKIP_PKG_INSTALL=TRUE${RESET_BOLD} must be set."
|
log "error" "A package installer must be passed to install missing packages, or ${GREEN}SKIP_PKG_INSTALL=TRUE${RESET_BOLD} must be set."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user