deps: Skip installing Rust if rustup is available
Saves time and prevents errors with trying to install rustup twice or potentially overriding the user's default toolchain.
This commit is contained in:
parent
71534e736c
commit
ba99aec1b7
@ -40,12 +40,14 @@ fi
|
|||||||
msg "Initializing submodules"
|
msg "Initializing submodules"
|
||||||
git submodule update --init --recursive
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
if ! which rustup &> /dev/null; then
|
||||||
msg "Installing Rust"
|
msg "Installing Rust"
|
||||||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs \
|
||||||
| sh -s -- -y --default-toolchain nightly
|
| sh -s -- -y --default-toolchain none
|
||||||
|
|
||||||
msg "Loading Rust environment"
|
msg "Loading Rust environment"
|
||||||
source "${HOME}/.cargo/env"
|
source "${HOME}/.cargo/env"
|
||||||
|
fi
|
||||||
|
|
||||||
msg "Installing pinned Rust toolchain"
|
msg "Installing pinned Rust toolchain"
|
||||||
rustup toolchain install "$(cat rust-toolchain)"
|
rustup toolchain install "$(cat rust-toolchain)"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user