From: Benjamin C Meyer Date: Wed, 25 Jan 2012 05:36:24 +0000 (-0500) Subject: Don't turn on set -e until after we test for the presence of aspell. X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=c92277bf74855ebb79f8662aa8ce9a2a3383168b;p=git-hooks.git Don't turn on set -e until after we test for the presence of aspell. Signed-off-by: Benjamin C Meyer --- diff --git a/contrib/commit-msg/spellcheck b/contrib/commit-msg/spellcheck index de4147c..0b9938d 100755 --- a/contrib/commit-msg/spellcheck +++ b/contrib/commit-msg/spellcheck @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright (c) 2010, Benjamin C. Meyer +# Copyright (c) 2010-2012, Benjamin C. Meyer # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -26,14 +26,15 @@ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # -set -e - function run_test { which aspell > /dev/null if [ ! $? -eq 0 ] ; then exit 0 fi + + set -e + warnings=`cat "${1}" | grep -v '^#.*' | aspell list` if [ ! -z "${warnings}" ] ; then echo >&2 "Possible spelling errors in the commit message:"