From 6db4bb68d18fa371fd2eac1e97f2e2413315ef5d Mon Sep 17 00:00:00 2001 From: Matt Cooper Date: Fri, 20 Mar 2020 14:53:00 -0400 Subject: compat with macOS's ancient Bash --- src/ci/scripts/setup-environment.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/ci/scripts') diff --git a/src/ci/scripts/setup-environment.sh b/src/ci/scripts/setup-environment.sh index 4f7641d50fa..d134fcd47ba 100755 --- a/src/ci/scripts/setup-environment.sh +++ b/src/ci/scripts/setup-environment.sh @@ -11,8 +11,14 @@ source "$(cd "$(dirname "$0")" && pwd)/../shared.sh" # Since matrix variables are readonly in Azure Pipelines, we take # INITIAL_RUST_CONFIGURE_ARGS and establish RUST_CONFIGURE_ARGS # which downstream steps can alter -if [[ -v INITIAL_RUST_CONFIGURE_ARGS ]]; then - ciCommandSetEnv RUST_CONFIGURE_ARGS "${INITIAL_RUST_CONFIGURE_ARGS}" +# macOS ships with Bash 3.16, so we cannot use [[ -v FOO ]], +# which was introduced in Bash 4.2 +if [[ -z "${INITIAL_RUST_CONFIGURE_ARGS+x}" ]]; then + INITIAL_RUST_CONFIG="" + echo "No initial Rust configure args set" +else + INITIAL_RUST_CONFIG="${INITIAL_RUST_CONFIGURE_ARGS}" + ciCommandSetEnv RUST_CONFIGURE_ARGS "${INITIAL_RUST_CONFIG}" fi # Builders starting with `dist-` are dist builders, but if they also end with -- cgit 1.4.1-3-g733a5