Install fails on Mac (no option -e for readlink) #38
Gaffney
commented
Jan 8, 2015
@faceleg I don't think this fixes it. Compare the Linux readlink -f to the Mac version:
Linux
-f, --canonicalize
canonicalize by following every symlink in every component
of the given name recursively; all but the last component must exist
Mac
-f format
Display information using the specified format.
See the FORMATS section for a description of valid formats.
See also:
faceleg
commented
Jan 8, 2015
Thanks, reopening.
Seeing as you have quick access to a mac (I assume), would you mind fixing this?
Gaffney
commented
Jan 8, 2015
I thought about it for a bit and I could not think of a clean fix, as installing coreutils is not a viable option. (That is what I did to fix it locally).
Can possibly think about it / fix it later this week or next when I am not so busy.
faceleg
commented
Jan 8, 2015
We could use something like:
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
SOURCE="$(readlink "$SOURCE")"
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"From http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in
Gaffney
commented
Jan 23, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no
-eoption on thereadlinkinstalled on Mac OSX, so the install fails completely (see L11 oninstallhere)Refer to this commit: 32fb793