Skip to content

Commit

Permalink
tools: fix wc compatibility problem in check-gogenerate.sh (#14435)
Browse files Browse the repository at this point in the history
  • Loading branch information
ffutop authored and sre-bot committed Jan 10, 2020
1 parent 8c3ee37 commit 01cf96e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/check/check-gogenerate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ set -euo pipefail

go generate ./...
set +e
diffline=$(git status -s | awk '{print $2}' | xargs grep '^// Code generated .* DO NOT EDIT\.$' 2>/dev/null | wc -l)
diffline=$(git status -s | awk '{print $2}' | xargs grep '^// Code generated .* DO NOT EDIT\.$' 2>/dev/null)
set -e
if [[ $diffline != 0 ]]
if [[ $diffline != "" ]]
then
echo "Your commit is changed after running go generate ./..., it should not hanppen."
exit 1
Expand Down

0 comments on commit 01cf96e

Please sign in to comment.