-
-
Save mslinn/1390651 to your computer and use it in GitHub Desktop.
Play Framework 2.0 start script for Cygwin (should work on all *nix variants)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
control_c() { | |
if $cygwin; then rm "$USERPROFILE"/play.boot.properties; fi | |
exit 1 | |
} | |
case "`uname`" in | |
CYGWIN*) cygwin=true;; | |
esac | |
PLAY_HOME="$(dirname $BASH_SOURCE)" | |
if $cygwin; then | |
PLAY_HOME_MIXED="$(cygpath -m $(dirname $BASH_SOURCE))" | |
PLAY_BOOT_PROPS="$(cygpath -u $(dirname $BASH_SOURCE)/framework/sbt/)"play.boot.properties | |
trap control_c SIGINT | |
cp "$PLAY_BOOT_PROPS" "$USERPROFILE" # cannot get this bugger to read the file any other way! | |
else | |
PLAY_HOME_MIXED="$PLAY_HOME" | |
fi | |
if [ -f conf/application.conf ]; then | |
if [ "$1" = "clean" ]; then | |
"$PLAY_HOME"/framework/cleanIvyCache | |
fi | |
if [ -n "$1" ]; then | |
"$PLAY_HOME"/framework/build "$@" | |
else | |
"$PLAY_HOME"/framework/build play | |
fi | |
else | |
for sbt in "$PLAY_HOME_MIXED"/framework/sbt/sbt-launch-*.jar; do | |
SBT="$sbt" # set $SBT to newest file present | |
done | |
java -Dsbt.ivy.home="$PLAY_HOME_MIXED"/repository \ | |
-Dplay.home="$PLAY_HOME_MIXED"/framework \ | |
-Dsbt.boot.properties="play.boot.properties" \ | |
-jar "$SBT" "$@" | |
if $cygwin; then rm "$USERPROFILE"/play.boot.properties; fi | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment