Skip to content

Commit f92da8e

Browse files
authored
Merge pull request #4108 from tgross35/set-u
Set `-u` (error on unset) in all script files
2 parents 22d4318 + 331dd50 commit f92da8e

16 files changed

+34
-37
lines changed

ci/android-install-ndk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22

3-
set -ex
3+
set -eux
44

55
ndk=android-ndk-r27
66
wget --tries=20 -q "https://dl.google.com/android/repository/${ndk}-linux.zip"

ci/android-install-sdk.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22

3-
set -ex
3+
set -eux
44

55
# Prep the SDK and emulator
66
#

ci/android-sysimage.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -ex
3+
set -eux
44

55
URL=https://dl.google.com/android/repository/sys-img/android
66

ci/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# The FILTER environment variable can be used to select which target(s) to build.
66
# For example: set FILTER to vxworks to select the targets that has vxworks in name
77

8-
set -ex
8+
set -eux
99

1010
: "${TOOLCHAIN?The TOOLCHAIN environment variable must be set.}"
1111
: "${OS?The OS environment variable must be set.}"

ci/docker/wasm32-unknown-emscripten/node-wrapper.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22

3-
set -e
3+
set -eux
44

55
me="$1"
66
shift

ci/emscripten-entry.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -ex
3+
set -eux
44

55
# shellcheck disable=SC1091
66
source /emsdk-portable/emsdk_env.sh &> /dev/null

ci/emscripten.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -ex
3+
set -eux
44

55
# Note: keep in sync with:
66
# https://github.com/rust-lang/rust/blob/master/src/ci/docker/scripts/emscripten.sh

ci/install-musl.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Install musl and musl-sanitized linux kernel headers
44
# to musl-{$1} directory
55

6-
set -ex
6+
set -eux
77

88
musl_version=1.1.24
99
musl="musl-${musl_version}"

ci/install-rust.sh

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
#!/usr/bin/env sh
22
# This is intended to be used in CI only.
33

4-
set -ex
4+
set -eux
55

66
echo "Setup toolchain"
7-
toolchain=
8-
if [ -n "$TOOLCHAIN" ]; then
9-
toolchain=$TOOLCHAIN
10-
else
11-
toolchain=nightly
12-
fi
137

14-
if [ "$OS" = "windows" ]; then
8+
toolchain="${TOOLCHAIN:-nightly}"
9+
os="${OS:-}"
10+
11+
if [ "$os" = "windows" ]; then
1512
: "${TARGET?The TARGET environment variable must be set.}"
1613
rustup set profile minimal
1714
rustup update --force "$toolchain-$TARGET"
@@ -22,18 +19,18 @@ else
2219
rustup default "$toolchain"
2320
fi
2421

25-
if [ -n "$TARGET" ]; then
22+
if [ -n "${TARGET:-}" ]; then
2623
echo "Install target"
2724
rustup target add "$TARGET"
2825
fi
2926

30-
if [ -n "$INSTALL_RUST_SRC" ]; then
27+
if [ -n "${INSTALL_RUST_SRC:-}" ]; then
3128
echo "Install rust-src"
3229
rustup component add rust-src
3330
fi
3431

35-
if [ "$OS" = "windows" ]; then
36-
if [ "$ARCH_BITS" = "i686" ]; then
32+
if [ "$os" = "windows" ]; then
33+
if [ "${ARCH_BITS:-}" = "i686" ]; then
3734
echo "Install MinGW32"
3835
choco install mingw --x86 --force
3936
fi
@@ -44,7 +41,7 @@ if [ "$OS" = "windows" ]; then
4441
/usr/bin/find "C:\ProgramData\Chocolatey" -name "dllcrt2*"
4542
/usr/bin/find "C:\ProgramData\Chocolatey" -name "libmsvcrt*"
4643

47-
if [ -n "$ARCH_BITS" ]; then
44+
if [ -n "${ARCH_BITS:-}" ]; then
4845
echo "Fix MinGW"
4946
for i in crt2.o dllcrt2.o libmingwex.a libmsvcrt.a ; do
5047
cp -f "/C/ProgramData/Chocolatey/lib/mingw/tools/install/mingw$ARCH_BITS/$ARCH-w64-mingw32/lib/$i" "$(rustc --print sysroot)/lib/rustlib/$TARGET/lib"

ci/linux-s390x.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env sh
22

3-
set -ex
3+
set -eux
44

55
mkdir -m 777 /qemu
66
cd /qemu

0 commit comments

Comments
 (0)