macos support (use perl for readlink -f)

This commit is contained in:
adam-bloom 2021-01-02 20:32:30 -07:00
parent 81fe5ad2cd
commit fb316a746a
2 changed files with 10 additions and 2 deletions

View File

@ -2,7 +2,11 @@
set -e
# Ensure we are in root directory
basedir="$(readlink -f `dirname $0`/..)"
if [[ $(uname) == "Darwin" ]]; then
basedir="$(perl -MCwd=abs_path -le 'print abs_path readlink(shift);' `dirname $0`/..)"
else
basedir="$(readlink -f `dirname $0`/..)"
fi
cd $basedir
if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then

View File

@ -2,7 +2,11 @@
set -e
# Ensure we are in root directory
basedir="$(readlink -f `dirname $0`/..)"
if [[ $(uname) == "Darwin" ]]; then
basedir="$(perl -MCwd=abs_path -le 'print abs_path readlink(shift);' `dirname $0`/..)"
else
basedir="$(readlink -f `dirname $0`/..)"
fi
cd $basedir/bin
# Scan objects first so that does not happen within a test