Skip to content

Commit

Permalink
build: fix xargs compatibility problem in check-gogenerate.sh (pingca…
Browse files Browse the repository at this point in the history
  • Loading branch information
SunRunAway authored and sre-bot committed Nov 1, 2019
1 parent aac4971 commit 79b4086
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/check/check-gogenerate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
set -euo pipefail

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

0 comments on commit 79b4086

Please sign in to comment.