From c92277bf74855ebb79f8662aa8ce9a2a3383168b Mon Sep 17 00:00:00 2001 From: Benjamin C Meyer Date: Wed, 25 Jan 2012 00:36:24 -0500 Subject: Don't turn on set -e until after we test for the presence of aspell. Signed-off-by: Benjamin C Meyer --- contrib/commit-msg/spellcheck | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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:" -- cgit v1.2.3