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"
|
_ls_bsd="BSD"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Test if readlink supports -f option, otherwise use perl (a bit slower)
|
# Test if readlink supports -f option, test for greadlink on Mac, then fallback to perl
|
||||||
if ! readlink -f / > /dev/null 2>&1; then
|
if \readlink -f / > /dev/null 2>&1; then
|
||||||
_abs_path_command=(perl -e 'use Cwd abs_path; print abs_path(shift)')
|
|
||||||
else
|
|
||||||
_abs_path_command=(readlink -f)
|
_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
|
fi
|
||||||
|
|
||||||
# Function wrapper around 'll'
|
# Function wrapper around 'll'
|
||||||
|
|||||||
Reference in New Issue
Block a user