From ab5de4e769da8153635c2bb89a8a9fdf306cfc89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Fri, 16 Jul 2010 14:29:24 +0200 Subject: [PATCH] Compatibility with Mac OS X Default wc command in Mac OS X does not have a '-L' option --- tools/git-hooks/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/git-hooks/pre-commit b/tools/git-hooks/pre-commit index e55ae06..72e4b5c 100755 --- a/tools/git-hooks/pre-commit +++ b/tools/git-hooks/pre-commit @@ -6,7 +6,7 @@ check_file() { name=$1 tmp=$2 - if [ `wc -L $tmp | awk '{ print $1 }'` -gt 80 ]; then + if [ `awk ' { if ( length > x ) { x = length } } END { print x }' $tmp` -gt 80 ]; then echo "File \"$name\" has lines with more than 80 columns." bad=1 fi