mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #7473 from open-sausages/pulls/4.0/fix-sake-path
BUG Fix sake path lookup to find vendor framework
This commit is contained in:
commit
3824655df4
20
sake
20
sake
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user