diff --git a/lib/git/shell_shortcuts.sh b/lib/git/shell_shortcuts.sh index 49d9b81..54f79ce 100644 --- a/lib/git/shell_shortcuts.sh +++ b/lib/git/shell_shortcuts.sh @@ -99,11 +99,13 @@ if ! ls --color=auto > /dev/null 2>&1; then _ls_bsd="BSD" fi -# Test if readlink supports -f option, otherwise use perl (a bit slower) -if ! readlink -f / > /dev/null 2>&1; then - _abs_path_command=(perl -e 'use Cwd abs_path; print abs_path(shift)') -else +# Test if readlink supports -f option, test for greadlink on Mac, then fallback to perl +if \readlink -f / > /dev/null 2>&1; then _abs_path_command=(readlink -f) +elif greadlink -f / > /dev/null 2>&1; then + _abs_path_command=(greadlink -f) +else + _abs_path_command=(perl -e 'use Cwd abs_path; print abs_path(shift)') fi # Function wrapper around 'll'