]> gitweb.fluxo.info Git - git-hooks.git/commitdiff
Fix OS X sort -V breakage
authorBenjamin C Meyer <ben@meyerhome.net>
Thu, 1 Sep 2011 14:54:29 +0000 (10:54 -0400)
committerBenjamin C Meyer <ben@meyerhome.net>
Thu, 1 Sep 2011 14:54:29 +0000 (10:54 -0400)
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>
git-hooks

index 3cce2420907f09e49bae428ca04a6ccb8f74330d..89f26a8204b4b0e966ad97d1a38d3125b27b6994 100755 (executable)
--- 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