Support coreutils on Mac, which provides a greadlink command that supports the -f option (brew install coreutils)
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user