compat with macOS's ancient Bash

This commit is contained in:
Matt Cooper 2020-03-20 14:53:00 -04:00
parent 330233470e
commit 6db4bb68d1

View file

@ -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