fix generate scripts

This commit is contained in:
Benjamin Elder
2018-09-14 17:29:45 -07:00
parent da1a2d92ab
commit a72682a826
2 changed files with 5 additions and 5 deletions

View File

@@ -26,6 +26,6 @@ GOBIN="${OUTPUT_GOBIN}" go install ./vendor/github.com/jteeuwen/go-bindata/go-bi
# go generate (using go-bindata)
# NOTE: go will only take package paths, not absolute directories
PATH="${OUTPUT_GOBIN}:${PATH}" go generate ./kind/...
PATH="${OUTPUT_GOBIN}:${PATH}" go generate ./...
# gofmt the generated file
find ./kind -name "*.go" -type f -print0 | xargs -0 gofmt -s -w

View File

@@ -22,15 +22,15 @@ set -o xtrace
REPO_ROOT=$(git rev-parse --show-toplevel)
cd "${REPO_ROOT}"
bazel build //kind/pkg/build/sources:bindata
bazel build //pkg/build/sources:bindata
BAZEL_GENERATED_BINDATA="bazel-genfiles/kind/pkg/build/sources/images_sources.go"
GO_GENERATED_BINDATA="kind/pkg/build/sources/images_sources.go"
BAZEL_GENERATED_BINDATA="bazel-genfiles/pkg/build/sources/images_sources.go"
GO_GENERATED_BINDATA="pkg/build/sources/images_sources.go"
DIFF="$(diff <(cat "${GO_GENERATED_BINDATA}") <(gofmt -s "${BAZEL_GENERATED_BINDATA}"))"
if [ ! -z "$DIFF" ]; then
echo "${GO_GENERATED_BINDATA} does not match ${BAZEL_GENERATED_BINDATA}"
echo "please run and commit: kind/hack/generate.sh"
echo "please run and commit: hack/generate.sh"
echo "if you have changed the generation, please ensure these remain identical"
echo "see: hack/bindata.bzl, pkg/build/sources/BUILD.bazel, pkg/build/sources/generate.go"
exit 1