mvn script is not compatible with OSX (Darwin)

Signed-off-by: Jason van Zyl <jason@tesla.io>

closes #39
This commit is contained in:
Arcadiy Ivanov 2015-03-10 03:50:17 -04:00 committed by Jason van Zyl
parent 08715d87d9
commit 2f21481d06
1 changed files with 6 additions and 1 deletions

View File

@ -145,7 +145,12 @@ if [ -z "$JAVA_HOME" ]; then
# readlink(1) is not available as standard on Solaris 10.
readLink=`which readlink`
if [ ! `expr "$readLink" : '\([^ ]*\)'` = "no" ]; then
javaExecutable="`readlink -f \"$javaExecutable\"`"
if $darwin ; then
javaHome="`dirname \"$javaExecutable\"`"
javaExecutable="`cd \"$javaHome\" && pwd -P`/javac"
else
javaExecutable="`readlink -f \"$javaExecutable\"`"
fi
javaHome="`dirname \"$javaExecutable\"`"
javaHome=`expr "$javaHome" : '\(.*\)/bin'`
JAVA_HOME="$javaHome"