2
0
mirror of https://github.com/gitwatch/gitwatch synced 2024-11-17 03:25:41 +00:00

Merge pull request #68 from vogler/no_greadlink

macOS: try greadlink -f, then readlink -f, then readlink and warn about it
This commit is contained in:
Dave Musicant 2019-12-10 11:27:26 -06:00 committed by GitHub
commit a44b78c1ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -185,7 +185,15 @@ trap "cleanup" EXIT # make sure the timeout is killed when exiting script
if [ "$(uname)" != "Darwin" ]; then
IN=$(readlink -f "$1")
else
IN=$(greadlink -f "$1")
if is_command "greadlink"; then
IN=$(greadlink -f "$1")
else
IN=$(readlink -f "$1")
if [ $? -eq 1 ]; then
echo "Seems like your readlink doesn't support '-f'. Running without. Please 'brew install coreutils'."
IN=$(readlink "$1")
fi
fi;
fi;