Build fail on OSX Yosemeite
Attempting to build in:/Library/Application Support/xonotic/modpack Running OSX 10.10.5
vrakbook:modpack vrak$ ./build.sh
readlink: illegal option -- f
usage: readlink [-n] [file ...]
./build.sh: line 20: cd: /Library/Application: No such file or directory
line 20 of build.sh is: b=; s=$(cd $(readlink -f ${1%%/}); pwd); d=$(cd $2; pwd)
pwd outputs /Library/Application Support/xonotic/modpack so the remainder of the path is ignored.
I used cd /Library/Application\ Support/xonotic/modpack to enter the directory, so that would be the correct path (that's how you cd into it), however I'm not sure how to edit build.sh to solve this. pwd does not output the \ that's needed where a path contains a space.
First issue is readlink on OSX does not have the -f, --canonicalize flag in the BSD implementation:
canonicalize by following every symlink in every component of the given name recursively;
all but the last component must exist
Some methods to bring this behavior to OSX are dirty, the BASH example in the thread below seems the cleanest in the sense that it's cross-platform without requiring an additional language (such as the perl-based solutions)
https://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
Thanks @z. I'll try that.