Skip to content

Instantly share code, notes, and snippets.

@RSchulz
Created Aug 17, 2012
Embed
What would you like to do?
#!/bin/bash
declare prob="${0##*/}"
declare progDir="${0%/*}"
declare sbtJAR="$progDir/sbt.jar"
declare -a jxArgs=( $SBT_JOPTS )
declare -a sysProps=()
declare -a sbtArgs=()
declare -a sbtConfig=()
for arg; do
case "$arg" in
--jar=*) sbtJAR="${arg#--jar=}" ;;
-X*) jxArgs=( "${jxArgs[@]}" "$arg" ); ;;
-D*) sysProps=( "${sysProps[@]}" "$arg" ); ;;
@*) sbtConfig=( "$arg" ) ;;
*) sbtArgs=( "${sbtArgs[@]}" "$arg" ); ;;
esac
done
if [ ${#sbtConfig[@]} -eq 0 -a "${SBT_CONFIG}" ]; then
sbtConfig=( "@${SBT_CONFIG#@}" )
fi
exec java -Xmx512M "${sysProps[@]}" -jar "$sbtJAR" "${sbtConfig[@]}" "${sbtArgs[@]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment