Skip to content

Instantly share code, notes, and snippets.

@tschaub
Created August 27, 2013 03:14
Show Gist options
  • Save tschaub/6349281 to your computer and use it in GitHub Desktop.
Save tschaub/6349281 to your computer and use it in GitHub Desktop.
OSX sbt launcher. Download sbt-launch.jar, put this script next to it, and create a symbolic link to this script on your path.
CWD=`pwd`
SELF=$0
cd `dirname $SELF`
SELF=`basename $SELF`
# Iterate down a (possible) chain of symlinks
while [ -L "$SELF" ]
do
SELF=`readlink $SELF`
cd `dirname $SELF`
SELF=`basename $SELF`
done
# Compute the canonicalized name by finding the physical path
# for the directory we're in and appending the target file.
PHYS_DIR=`pwd -P`
LAUNCH="$PHYS_DIR"/sbt-launch.jar
cd $CWD
SBT_OPTS="-Xms512M -Xmx1536M -Xss1M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256M"
java $SBT_OPTS -jar "$LAUNCH" "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment