BUG Fix sake path lookup to find vendor framework

Remove legacy sapphire lookup
This commit is contained in:
Damian Mooyman 2017-10-12 15:45:43 +13:00
parent d876e36424
commit 5ccbabd36c
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A
1 changed files with 10 additions and 10 deletions

20
sake
View File

@ -24,12 +24,12 @@ else
directory="$PWD"
base=.
for (( n=${#slashes}; n>0; --n )) do
if [ -d "$directory/framework" ]; then
framework="$directory/framework"
if [ -d "$directory/vendor/silverstripe/framework" ]; then
framework="$directory/vendor/silverstripe/framework"
break
elif [ -d "$directory/sapphire" ]; then
framework="$directory/sapphire"
elif [ -d "$directory/framework" ]; then
framework="$directory/framework"
break
fi
@ -74,20 +74,20 @@ if [ "$1" = "-start" ]; then
echo "You need to install the 'daemon' tool. In debian, go 'sudo apt-get install daemon'"
exit 1
fi
if [ ! -f $base/$2.pid ]; then
echo "Starting service $2 $3"
touch $base/$2.pid
pidfile=`realpath $base/$2.pid`
outlog=$base/$2.log
errlog=$base/$2.err
echo "Logging to $outlog"
sake=`realpath $0`
base=`realpath $base`
# if third argument is not explicitly given, copy from second argument
if [ "$3" = "" ]; then
url=$2
@ -95,7 +95,7 @@ if [ "$1" = "-start" ]; then
url=$3
fi
# TODO: Give a globally unique processname by including the projectname as well
# TODO: Give a globally unique processname by including the projectname as well
processname=$2
daemon -n $processname -r -D $base --pidfile=$pidfile --stdout=$outlog --stderr=$errlog $sake $url
@ -109,7 +109,7 @@ if [ "$1" = "-stop" ]; then
pidfile=$base/$2.pid
if [ -f $pidfile ]; then
echo "Stopping service $2"
# TODO: This is a bad way of killing the process
kill -KILL `cat $pidfile`
unlink $pidfile