build: Ensure correct go-bindata is used
This commit ensures that the downloaded version of go-bindata is used
in the build rather than just any go-bindata in the PATH. This led to
some inconsistencies between data generated in local and CI builds.
@@ -24,9 +24,14 @@ set -o pipefail
ROOT_DIR="$(cd "$(dirname "$0")/.." ; pwd)"
-if command -v go-bindata > /dev/null; then
cd "${ROOT_DIR}"
- "go-bindata" \
+
+if [ ! -x "${ROOT_DIR}"/bin/go-bindata ]; then
+ echo "go-bindata is not found. Use './scripts/download-binaries.sh' to download it."
+ exit 1
+fi
+
+"${ROOT_DIR}"/bin/go-bindata \
-nocompress \
-nometadata \
-pkg 'common' \
@@ -37,8 +42,3 @@ if command -v go-bindata > /dev/null; then
cat ./hack/boilerplate.go.txt ./test/common/bindata.go > bindatatmp \
&& mv bindatatmp ./test/common/bindata.go
-else
- echo "go-bindata is not found. Use './scripts/download-binaries.sh' to download it."
- exit 1
-fi
-
