diff --git a/pre-commit b/pre-commit index 95299e4..1308f40 100755 --- a/pre-commit +++ b/pre-commit @@ -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