mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-08-29 04:51:34 +00:00
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 <steven@uk.ibm.com>
This commit is contained in:
parent
9379a18c8a
commit
ac17506bae
@ -9,6 +9,8 @@ set -o errexit
|
|||||||
set -o nounset
|
set -o nounset
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
|
[[ -n "${DEBUG:-}" ]] && set -x
|
||||||
|
|
||||||
tmp_dir=$(mktemp -d -t install-go-tmp.XXXXXXXXXX)
|
tmp_dir=$(mktemp -d -t install-go-tmp.XXXXXXXXXX)
|
||||||
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
script_name="$(basename "${BASH_SOURCE[0]}")"
|
script_name="$(basename "${BASH_SOURCE[0]}")"
|
||||||
@ -90,9 +92,9 @@ fi
|
|||||||
goarch=$(arch_to_golang)
|
goarch=$(arch_to_golang)
|
||||||
|
|
||||||
info "Download go version ${go_version}"
|
info "Download go version ${go_version}"
|
||||||
kernel_name=$(uname -s)
|
kernel_name=$(uname -s | tr '[:upper:]' '[:lower:]')
|
||||||
curl -OL "https://storage.googleapis.com/golang/go${go_version}.${kernel_name,,}-${goarch}.tar.gz"
|
curl -OL "https://storage.googleapis.com/golang/go${go_version}.${kernel_name}-${goarch}.tar.gz"
|
||||||
info "Install go"
|
info "Install go"
|
||||||
mkdir -p "${install_dest}"
|
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
|
popd
|
||||||
|
Loading…
Reference in New Issue
Block a user