fork of https://github.com/sourcegraph/zoekt
1#!/usr/bin/env bash
2
3cd "$(dirname "${BASH_SOURCE[0]}")/../.."
4set -euo pipefail
5
6find . -name "buf.gen.yaml" -not -path ".git" | while read -r buf_yaml; do
7 pushd "$(dirname "${buf_yaml}")" >/dev/null
8
9 if ! buf generate; then
10 echo "running buf generate on ${buf_yaml} failed, please examine the output and fix the issues"
11 exit 1
12 fi
13
14 popd >/dev/null
15done
16
17if ! git diff --exit-code; then
18 echo "buf generate produced changes in the above file(s), please run buf generate and commit the changes"
19 exit 1
20fi
21
22if ! (git ls-files --others --exclude-standard . | tee >(grep -q .)); then
23 echo "buf generate produced the above untracked file(s), please run buf generate and commit them"
24 exit 1
25fi