mirror of https://github.com/k3s-io/k3s
If we already have the right version of gazel installed, use it
parent
b4c71b1f26
commit
37dda6c2fd
|
@ -20,18 +20,17 @@ set -o pipefail
|
|||
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
git config http.https://gopkg.in.followRedirects true
|
||||
|
||||
go get -u gopkg.in/mikedanese/gazel.v14/gazel
|
||||
go get gopkg.in/mikedanese/gazel.v14/gazel
|
||||
|
||||
for path in ${GOPATH//:/ }; do
|
||||
if [[ -e "${path}/bin/gazel" ]]; then
|
||||
gazel="${path}/bin/gazel"
|
||||
break
|
||||
fi
|
||||
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})"
|
||||
|
|
|
@ -20,10 +20,20 @@ set -o pipefail
|
|||
export KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
git config http.https://gopkg.in.followRedirects true
|
||||
go get gopkg.in/mikedanese/gazel.v14/gazel
|
||||
|
||||
go get -u gopkg.in/mikedanese/gazel.v14/gazel
|
||||
if ! "${GOPATH}/bin/gazel" -validate -print-diff -root="$(kube::realpath ${KUBE_ROOT})" ; then
|
||||
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
|
||||
|
||||
if ! "${gazel}" -validate -print-diff -root="$(kube::realpath ${KUBE_ROOT})" ; then
|
||||
echo
|
||||
echo "Run ./hack/update-bazel.sh"
|
||||
exit 1
|
||||
|
|
Loading…
Reference in New Issue