From 11d74e69a60bacdc414d48f4ae28082e1e92d926 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emil=20Gardstr=C3=B6m?= Date: Fri, 8 Jul 2022 22:40:56 +0200 Subject: [PATCH] make env var uppercase --- ci/test-cross-image.sh | 6 ++++-- ci/test-docker-in-docker.sh | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ci/test-cross-image.sh b/ci/test-cross-image.sh index a591ba684..25fcf6d49 100755 --- a/ci/test-cross-image.sh +++ b/ci/test-cross-image.sh @@ -7,10 +7,12 @@ set -eo pipefail if [[ -z "${TARGET}" ]]; then export TARGET="aarch64-unknown-linux-gnu" fi +# ^^subst is not supported on macOS bash (bash <4) +export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}') if [[ "${IMAGE}" ]]; then # shellcheck disable=SC2140 - export "CROSS_TARGET_${TARGET//-/_}_IMAGE"="${IMAGE}" + export "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE"="${IMAGE}" fi if [[ -z "${CROSS_TARGET_CROSS_IMAGE}" ]]; then @@ -20,7 +22,7 @@ fi main() { - docker run --rm -e TARGET -e "CROSS_TARGET_${TARGET//-/_}_IMAGE" \ + docker run --rm -e TARGET -e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \ -v /var/run/docker.sock:/var/run/docker.sock \ "${CROSS_TARGET_CROSS_IMAGE}" sh -c ' #!/usr/bin/env sh diff --git a/ci/test-docker-in-docker.sh b/ci/test-docker-in-docker.sh index c9a33c021..6c300a506 100755 --- a/ci/test-docker-in-docker.sh +++ b/ci/test-docker-in-docker.sh @@ -9,10 +9,12 @@ set -eo pipefail if [[ -z "${TARGET}" ]]; then export TARGET="aarch64-unknown-linux-gnu" fi +# ^^subst is not supported on macOS bash (bash <4) +export TARGET_UPPER=$(echo "$TARGET" | awk '{print toupper($0)}') if [[ "${IMAGE}" ]]; then # shellcheck disable=SC2140 - export "CROSS_TARGET_${TARGET//-/_}_IMAGE"="${IMAGE}" + export "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE"="${IMAGE}" fi source=$(dirname "${BASH_SOURCE[0]}") @@ -23,7 +25,7 @@ main() { docker run -v "${home}":"${home}" -w "${home}" \ --rm -e TARGET -e RUSTFLAGS -e RUST_TEST_THREADS \ -e LLVM_PROFILE_FILE -e CARGO_INCREMENTAL \ - -e "CROSS_TARGET_${TARGET//-/_}_IMAGE" \ + -e "CROSS_TARGET_${TARGET_UPPER//-/_}_IMAGE" \ -v /var/run/docker.sock:/var/run/docker.sock \ docker:18.09-dind sh -c ' #!/usr/bin/env sh