Merge pull request #24 from Atry/full-packaging

Check $JAVA_HOME, and quote arguments and $JAVA_CMD
This commit is contained in:
Josh Suereth 2012-10-25 09:30:33 -07:00
commit a934680c8d
1 changed files with 8 additions and 3 deletions

View File

@ -1,7 +1,12 @@
#!/bin/sh #!/bin/sh
# sbt launcher script for Cygwin and MSYS # sbt launcher script for Cygwin and MSYS
if [ -z "$JAVA_HOME" ]; then
JAVA_CMD=java JAVA_CMD=java
else
JAVA_CMD=$JAVA_HOME/bin/java
fi
JAVA_OPTS=-Xmx512M JAVA_OPTS=-Xmx512M
UDIR=`dirname "$0"` UDIR=`dirname "$0"`
@ -14,9 +19,9 @@ fi
if [ "_$TERM" = "_xterm" ]; then if [ "_$TERM" = "_xterm" ]; then
# Let the terminal handle ANSI sequences # Let the terminal handle ANSI sequences
stty -icanon min 1 -echo > /dev/null 2>&1 stty -icanon min 1 -echo > /dev/null 2>&1
$JAVA_CMD $JAVA_OPTS -Djline.terminal=jline.UnixTerminal -jar "$WDIR/sbt-launch.jar" $@ "$JAVA_CMD" $JAVA_OPTS -Djline.terminal=jline.UnixTerminal -jar "$WDIR/sbt-launch.jar" "$@"
stty icanon echo > /dev/null 2>&1 stty icanon echo > /dev/null 2>&1
else else
# Use Jansi to intercept ANSI sequences # Use Jansi to intercept ANSI sequences
$JAVA_CMD $JAVA_OPTS -Dsbt.log.format=true -cp "$WDIR/jansi.jar;$WDIR/sbt-launch.jar;$WDIR/classes" SbtJansiLaunch $@ "$JAVA_CMD" $JAVA_OPTS -Dsbt.log.format=true -cp "$WDIR/jansi.jar;$WDIR/sbt-launch.jar;$WDIR/classes" SbtJansiLaunch "$@"
fi fi