From ac17506bae910a79d0f2cdb4338aa7811e5179cb Mon Sep 17 00:00:00 2001 From: stevenhorsman Date: Mon, 21 Jul 2025 16:09:13 +0100 Subject: [PATCH] ci: Make install_go.sh more portable `${kernel_name,,}` is bash 4.0 and not posix compliant, so doesn't work on macos, so switch to `tr` which is more widely supported Signed-off-by: stevenhorsman --- tests/install_go.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/install_go.sh b/tests/install_go.sh index 45eadf3ba9..300bac8f07 100755 --- a/tests/install_go.sh +++ b/tests/install_go.sh @@ -9,6 +9,8 @@ set -o errexit set -o nounset set -o pipefail +[[ -n "${DEBUG:-}" ]] && set -x + tmp_dir=$(mktemp -d -t install-go-tmp.XXXXXXXXXX) script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" script_name="$(basename "${BASH_SOURCE[0]}")" @@ -90,9 +92,9 @@ fi goarch=$(arch_to_golang) info "Download go version ${go_version}" -kernel_name=$(uname -s) -curl -OL "https://storage.googleapis.com/golang/go${go_version}.${kernel_name,,}-${goarch}.tar.gz" +kernel_name=$(uname -s | tr '[:upper:]' '[:lower:]') +curl -OL "https://storage.googleapis.com/golang/go${go_version}.${kernel_name}-${goarch}.tar.gz" info "Install go" mkdir -p "${install_dest}" -sudo tar -C "${install_dest}" -xzf "go${go_version}.${kernel_name,,}-${goarch}.tar.gz" +sudo tar -C "${install_dest}" -xzf "go${go_version}.${kernel_name}-${goarch}.tar.gz" popd