Exit correctly if shellcheck detects problems

This commit is contained in:
Nick Chambers 2021-06-19 14:58:31 -05:00
parent bdb61a02cc
commit 78750190ad
1 changed files with 2 additions and 2 deletions

View File

@ -20,8 +20,8 @@ git status -zu | while read -rd '' xy filename; do
fi
if [[ $filename = *.sh ]] || is_a "$filename" bash; then
if has shellcheck; then
shellcheck -s bash "$filename"
if has shellcheck && ! shellcheck -s bash "$filename"; then
exit 1
fi
fi
done