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