Skip to content

Commit

Permalink
fix: avoid calling defaults on newly installed toolchain
Browse files Browse the repository at this point in the history
  • Loading branch information
nick0602 committed Sep 13, 2022
1 parent 8b986aa commit 62335eb
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ fi
# Export PATH via envman to make the toolchain available for the next steps.
envman add --key "PATH" --value "${PATH}:${HOME}/.cargo/bin"

# Calling set_default_rustup() to ensure the required version of rustc is used, as ~/.rustup/settings.toml might have been restored from cache.
set_default_rustup

# Update is not performed on first install as the download has just happened. Auto update is also applied only on stable or nightly versions.
if [[ "${RUST_AUTO_UPDATE_TOOLCHAIN}" = true && "${IS_FIRST_INSTALL}" = false && ("${RUST_VERSION}" = "stable" || "${RUST_VERSION}" = "nightly") ]]; then
update_rustup
if [ "${IS_FIRST_INSTALL}" = false ]; then
# Calling set_default_rustup() to ensure the required version of rustc is used, as ~/.rustup/settings.toml might have been restored from cache.
set_default_rustup

# Auto update is applied only on stable or nightly versions.
if [[ "${RUST_AUTO_UPDATE_TOOLCHAIN}" = true && ("${RUST_VERSION}" = "stable" || "${RUST_VERSION}" = "nightly") ]]; then
update_rustup
fi
fi

# Use envman to add versions as ENV.
Expand Down

0 comments on commit 62335eb

Please sign in to comment.