forked from playframework/playframework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
play
executable file
·57 lines (49 loc) · 1.3 KB
/
play
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#! /usr/bin/env sh
PRG="$0"
# resolve relative/absolute symlinks
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
dir=`dirname "$PRG"`
PRG="$dir/$link"
fi
done
dir=`dirname "$PRG"`
if [ -z "$JAVA_HOME" ]; then
JAVA="java"
else
JAVA="$JAVA_HOME/bin/java"
fi
if [ -f conf/application.conf -o -f conf/reference.conf ] || [ -d project ]; then
if test "$1" = "stop"; then
if [ -f RUNNING_PID ]; then
echo "[info] Stopping application (with PID `cat RUNNING_PID`)..."
kill `cat RUNNING_PID`
RESULT=$?
if test "$RESULT" = 0; then
echo "[info] Done!"
exit 0
else
echo "[\033[31merror\033[0m] Failed ($RESULT)"
exit $RESULT
fi
else
echo "[\033[31merror\033[0m] No RUNNING_PID file. Is this application running?"
exit 1
fi
fi
if test "$1" = "debug"; then
JPDA_PORT="9999"
shift
fi
if [ -n "$1" ]; then
JPDA_PORT="${JPDA_PORT}" "$dir/framework/build" "$@"
else
JPDA_PORT="${JPDA_PORT}" "$dir/framework/build" play
fi
else
"$JAVA" -Dplay.home="$dir/framework" -Dsbt.boot.properties="$dir/framework/sbt/play.boot.properties" ${PLAY_OPTS} -jar "$dir/framework/sbt/sbt-launch.jar" "$@"
fi