mirror of
https://github.com/kubernetes-sigs/kind.git
synced 2025-12-01 07:26:05 +07:00
fix gimme go version noise
This commit is contained in:
@@ -19,13 +19,21 @@
|
||||
# read go-version file unless GO_VERSION is set
|
||||
GO_VERSION="${GO_VERSION:-"$(cat .go-version)"}"
|
||||
|
||||
# we don't actually care where the .env files are
|
||||
# however, GIMME_SILENT_ENV doesn't trigger re-generating a .env if it
|
||||
# already exists and isn't "silent" (no `go version` command in it)
|
||||
# so we fix that by changing where the .env is written, ensuring ours
|
||||
# is generated from this repo and silent.
|
||||
export GIMME_ENV_PREFIX=./bin/.gimme/
|
||||
export GIMME_SILENT_ENV=y
|
||||
|
||||
# only setup go if we haven't set FORCE_HOST_GO, or `go version` doesn't match
|
||||
# go version output looks like:
|
||||
# go version go1.14.5 darwin/amd64
|
||||
if ! ([ -n "${FORCE_HOST_GO:-}" ] || \
|
||||
(command -v go >/dev/null && [ "$(go version | cut -d' ' -f3)" = "go${GO_VERSION}" ])); then
|
||||
# eval because the output of this is shell to set PATH etc.
|
||||
eval "$(hack/third_party/gimme/gimme "${GO_VERSION}" 2>/dev/null)"
|
||||
eval "$(hack/third_party/gimme/gimme "${GO_VERSION}")"
|
||||
fi
|
||||
|
||||
# force go modules
|
||||
|
||||
Reference in New Issue
Block a user