Skip to content

Commit

Permalink
Fixed the boilerplate hook to work on OS X, where apparently wc add's…
Browse files Browse the repository at this point in the history
… spaces
  • Loading branch information
brendandburns committed Jun 24, 2014
1 parent 20ba523 commit 2c404ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions hooks/boilerplate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 2c404ab

Please sign in to comment.