Skip to content

Commit 9329070

Browse files
committed
fix: install script failure
1 parent 4cead47 commit 9329070

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/install-mdbook.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,13 @@ echo "Installing Rust and mdBook into ${REPO_ROOT} (RUSTUP_HOME=$RUSTUP_HOME, CA
2020
if [ ! -x "${CARGO_HOME}/bin/rustup" ]; then
2121
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
2222
fi
23-
source "${CARGO_HOME}/env"
23+
# rustup creates .cargo/env; CI may restore .cargo/bin from cache without env (not cached).
24+
if [[ -f "${CARGO_HOME}/env" ]]; then
25+
# shellcheck source=/dev/null
26+
source "${CARGO_HOME}/env"
27+
else
28+
export PATH="${CARGO_HOME}/bin:${PATH}"
29+
fi
2430

2531
rustup toolchain install "${RUST_TOOLCHAIN_VERSION}" --profile minimal
2632
rustup default "${RUST_TOOLCHAIN_VERSION}"

0 commit comments

Comments
 (0)