From 2c404aba0f09cd54440951b9797ee4861afb6c83 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Tue, 24 Jun 2014 15:02:48 -0700 Subject: [PATCH] Fixed the boilerplate hook to work on OS X, where apparently wc add's spaces --- hooks/boilerplate.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hooks/boilerplate.sh b/hooks/boilerplate.sh index 33c31cbf5b9..cfe2af7b6b3 100755 --- a/hooks/boilerplate.sh +++ b/hooks/boilerplate.sh @@ -2,8 +2,8 @@ # Print 1 if the file in $1 has the correct boilerplate header, 0 otherwise. FILE=$1 -LINES=$(cat "$(dirname $0)/boilerplate.txt" | wc -l) -DIFFER=$(head -$LINES "${FILE}" | diff -q - "$(dirname $0)/boilerplate.txt") +LINES=$(cat "$(dirname $0)/boilerplate.txt" | wc -l | tr -d ' ') +DIFFER=$(head "-${LINES}" "${FILE}" | diff -q - "$(dirname $0)/boilerplate.txt") if [[ -z "${DIFFER}" ]]; then echo "1"