aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin C Meyer <ben@meyerhome.net>2011-09-01 10:54:29 -0400
committerBenjamin C Meyer <ben@meyerhome.net>2011-09-01 10:54:29 -0400
commit478f5543674fd92006fd07ea3dfefe743f37b7fc (patch)
tree09da4d0829e04675b056f4467dace86d1b8b6e77
parent792aae9b51a8c9e65a3d760f0bf6c155fd507edf (diff)
downloadgit-hooks-478f5543674fd92006fd07ea3dfefe743f37b7fc.tar.gz
git-hooks-478f5543674fd92006fd07ea3dfefe743f37b7fc.tar.bz2
Fix OS X sort -V breakage
The -V option to sort is not include in OS X's sort so special case OS X. Signed-off-by: Benjamin C Meyer <ben@meyerhome.net>
-rwxr-xr-xgit-hooks6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-hooks b/git-hooks
index 3cce242..89f26a8 100755
--- a/git-hooks
+++ b/git-hooks
@@ -43,7 +43,11 @@ function hook_dirs
function list_hooks_in_dir
{
- find "${1}/" -executable -type f 2>/dev/null | grep -v "^.$" | sort -V
+ if [ $OSTYPE = "darwin10.0" ] ; then
+ find "${1}/" -executable -type f 2>/dev/null | grep -v "^.$" | sort
+ else
+ find "${1}/" -executable -type f 2>/dev/null | grep -v "^.$" | sort -V
+ fi
}
function run_hooks