Skip to content

Commit

Permalink
ci: Fix cases where unset variables cause errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 committed Nov 18, 2024
1 parent 59a18de commit d76aa65
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions ci/install-rust.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,11 @@
set -eux

echo "Setup toolchain"
toolchain=
if [ -n "$TOOLCHAIN" ]; then
toolchain=$TOOLCHAIN
else
toolchain=nightly
fi

if [ "$OS" = "windows" ]; then
toolchain="${TOOLCHAIN:-nightly}"
os="${OS:-}"

if [ "$os" = "windows" ]; then
: "${TARGET?The TARGET environment variable must be set.}"
rustup set profile minimal
rustup update --force "$toolchain-$TARGET"
Expand All @@ -22,17 +19,17 @@ else
rustup default "$toolchain"
fi

if [ -n "$TARGET" ]; then
if [ -n "${TARGET:-}" ]; then
echo "Install target"
rustup target add "$TARGET"
fi

if [ -n "$INSTALL_RUST_SRC" ]; then
if [ -n "${INSTALL_RUST_SRC:-}" ]; then
echo "Install rust-src"
rustup component add rust-src
fi

if [ "$OS" = "windows" ]; then
if [ "$os" = "windows" ]; then
if [ "$ARCH_BITS" = "i686" ]; then
echo "Install MinGW32"
choco install mingw --x86 --force
Expand Down

0 comments on commit d76aa65

Please sign in to comment.