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 0452fe6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 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
2 changes: 1 addition & 1 deletion ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ target="$1"
#
# It's assume that all images, when run with two disks, will run the `run.sh`
# script from the second which we place inside.
if [ "$QEMU" != "" ]; then
if [ -n "${QEMU:-}" ]; then
tmpdir=/tmp/qemu-img-creation
mkdir -p "${tmpdir}"

Expand Down

0 comments on commit 0452fe6

Please sign in to comment.