Permalink
Browse files

Merge pull request #777 from mikemckibben/fix/play_launch_script_rels…

…ymlinks

add support for relative symbolic link to play launch script. Fixes tick...
  • Loading branch information...
2 parents 2464219 + 5dfd274 commit 626d2ca4bb1a7260b832c336e0e3e969e0753ea9 @huntc huntc committed Apr 8, 2013
Showing with 10 additions and 4 deletions.
  1. +10 −4 play
View
@@ -1,16 +1,22 @@
#! /usr/bin/env sh
PRG="$0"
+# resolve relative/absolute symlinks
while [ -h "$PRG" ] ; do
- PRG=`readlink "$PRG"`
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG="`dirname "$PRG"`/$link"
+ fi
done
-
dir=`dirname $PRG`
if [ -z "$JAVA_HOME" ]; then
- JAVA="java"
+ JAVA="java"
else
- JAVA="$JAVA_HOME/bin/java"
+ JAVA="$JAVA_HOME/bin/java"
fi
if [ -f conf/application.conf -o -f conf/reference.conf ] || [ -d project ]; then

0 comments on commit 626d2ca

Please sign in to comment.