-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check that generated files are up to date (#1233)
- Loading branch information
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o nounset | ||
set -o pipefail | ||
# intentionally not setting 'set -o errexit' because we want to print custom error messages | ||
|
||
# make sure make generate can be invoked | ||
make generate | ||
RETVAL=$? | ||
if [[ ${RETVAL} != 0 ]]; then | ||
echo "Invoking 'make generate' ends with non-zero exit code." | ||
exit 1 | ||
fi | ||
|
||
git diff --exit-code --quiet | ||
RETVAL=$? | ||
|
||
if [[ ${RETVAL} != 0 ]]; then | ||
echo "Running 'make generate' produces changes to the current git status. Maybe you forgot to check-in your updated generated files?" | ||
echo "The current diff: `git diff`" | ||
exit 1 | ||
fi | ||
|
||
echo "Verifying 'make generate' was successful! ヽ(•‿•)ノ" | ||
exit 0 |