Update check to use buildifier's exit status instead.

buildifer 0.12.0 release sets the exit status for diff.
This commit is contained in:
Thomas Van Lenten 2018-06-12 11:59:45 -04:00
parent 9430df29e4
commit a5431b7bab
1 changed files with 1 additions and 2 deletions

View File

@ -26,8 +26,7 @@ fi
# Asked to do a buildifier run.
if [[ -n "${BUILDIFER:-}" ]]; then
# bazelbuild/buildtools/issues/220 - diff doesn't include the file that needs updating
# bazelbuild/buildtools/issues/221 - the exist status is always zero.
if [[ -n "$(find . -name BUILD -print | xargs buildifier -v -d)" ]]; then
if ! find . -name BUILD -print | xargs buildifier -d > /dev/null 2>&1 ; then
echo "ERROR: BUILD file formatting issue(s)"
find . -name BUILD -print -exec buildifier -v -d {} \;
exit 1