From 2dc36870c4edf7407c48586e2dfa24457063fb9d Mon Sep 17 00:00:00 2001 From: Jacob Simpson Date: Wed, 15 Feb 2017 14:39:02 -0800 Subject: [PATCH] update-bazel.sh to treat GOPATH as a path Adds functionality to look at the components of the GOPATH looking for the gazel executable, rather than treating the GOPATH as if it was a single directory. --- hack/update-bazel.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/hack/update-bazel.sh b/hack/update-bazel.sh index fb707a5ab60..0afaf780d5b 100755 --- a/hack/update-bazel.sh +++ b/hack/update-bazel.sh @@ -23,4 +23,15 @@ source "${KUBE_ROOT}/hack/lib/init.sh" git config http.https://gopkg.in.followRedirects true go get -u gopkg.in/mikedanese/gazel.v14/gazel -"${GOPATH}/bin/gazel" -root="$(kube::realpath ${KUBE_ROOT})" + +for path in ${GOPATH//:/ }; do + if [[ -e "${path}/bin/gazel" ]]; then + gazel="${path}/bin/gazel" + break + fi +done +if [[ -z "${gazel:-}" ]]; then + echo "Couldn't find gazel on the GOPATH." + exit 1 +fi +"${gazel}" -root="$(kube::realpath ${KUBE_ROOT})"