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:
committed by
Jeremy Soller
parent
07dfef8cb9
commit
541f4f3f13
@ -80,12 +80,14 @@ curl -sSf https://review.coreboot.org/tools/hooks/commit-msg \
|
||||
-o .git/modules/coreboot/hooks/commit-msg && \
|
||||
chmod +x .git/modules/coreboot/hooks/commit-msg
|
||||
|
||||
if ! which rustup &> /dev/null; then
|
||||
msg "Installing Rust"
|
||||
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"
|
||||
source ~/.cargo/env
|
||||
source "${HOME}/.cargo/env"
|
||||
fi
|
||||
|
||||
msg "Installing pinned Rust toolchain"
|
||||
rustup toolchain install "$(cat rust-toolchain)"
|
||||
|
Reference in New Issue
Block a user