feat: only update toolchain if it is 'nightly'
All checks were successful
/ test (map[name:v1.81.0]) (push) Successful in 46s
/ test (map[name:nightly]) (push) Successful in 2m55s
/ test (map[name:stable]) (push) Successful in 4m54s

This commit is contained in:
Paul Campbell 2024-11-14 07:39:53 +00:00
parent 6ffa2b739c
commit f710a77230

View file

@ -15,6 +15,8 @@ echo "Default toolchain: ${TOOLCHAIN}"
if test "${ARGS[0]}" == "nightly"; then
TOOLCHAIN="nightly"
ARGS=("${ARGS[@]:1}")
echo ">>> Update nightly toolchain"
rustup update "${TOOLCHAIN}"
fi
if test "${ARGS[0]}" == "stable"; then
TOOLCHAIN="stable" # redundant as this is the default
@ -26,8 +28,6 @@ if [[ "${ARGS[0]}" == v1* ]]; then
fi
echo "Selected toolchain: ${TOOLCHAIN}"
echo ">>> Update toolchain"
rustup update "${TOOLCHAIN}"
echo ">>> Install rustfmt and clippy"
rustup component add --toolchain "${TOOLCHAIN}" rustfmt clippy