Improved symlink dereferencing on OSX by calling a perl script.

This commit is contained in:
Dominik Ritter 2016-01-09 16:25:15 +01:00
parent c84da5e744
commit 989a9b3b4b

View file

@ -51,7 +51,7 @@ fi
# If this theme is sourced as a symlink, we need to locate the true URL
if [[ -L $0 ]]; then
# Script is a symlink
filename="$(realpath -P $0 2>/dev/null || readlink -f $0 2>/dev/null)"
filename="$(realpath -P $0 2>/dev/null || readlink -f $0 2>/dev/null || perl -MCwd=abs_path -le 'print abs_path readlink(shift);' $0 2>/dev/null)"
elif [[ -f $0 ]]; then
# Script is a file
filename="$0"