Files
prysm/hack/check-logs.sh
Bastin c8012b41f9 Fix bug in check-logs (#16287)
**What does this PR do? Why is it needed?**
Fixing a bug in `check-logs.sh` where untracked files were ignored. 
for example PR #16216 passed the check while it shouldn't have. this
change fixes the problem.
2026-01-26 16:28:46 +00:00

22 lines
546 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
ROOT_DIR="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
cd "$ROOT_DIR"
# Regenerate all log.go files
./hack/gen-logs.sh
# Fail if that changed anything
if ! git diff --quiet -- ./ || [[ -n "$(git ls-files --others --exclude-standard -- ./)" ]]; then
echo "ERROR: log.go files are out of date. Please run:"
echo " ./hack/gen-logs.sh"
echo "and commit the changes."
echo
git diff --stat -- ./ || true
git status --porcelain -- ./ || true
exit 1
fi
echo "log.go files are up to date."