mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
1759038d58
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@60355 467b73ca-7a2a-4603-9d3b-597d59a354a9
41 lines
733 B
Plaintext
Executable File
41 lines
733 B
Plaintext
Executable File
# Check for an argument
|
|
if [ $1 = "" ]; then
|
|
echo "Sapphire Sake
|
|
|
|
Usage: $0 (command-url) (params)
|
|
Executes a Sapphire command"
|
|
exit 1
|
|
fi
|
|
|
|
# Special case for "sake installsake"
|
|
if [ "$1" = "installsake" ]; then
|
|
echo "Installing sake to /usr/bin..."
|
|
cp $0 /usr/bin
|
|
exit 0
|
|
fi
|
|
|
|
# Find the PHP binary
|
|
for candidatephp in php5 php; do
|
|
if [ `which $candidatephp` -a -f `which $candidatephp` ]; then
|
|
php=`which $candidatephp`
|
|
break
|
|
fi
|
|
done
|
|
|
|
if [ "$php" = "" ]; then
|
|
echo "Can't find any php binary"
|
|
exit 2
|
|
fi
|
|
|
|
if [ -d ./sapphire ]; then
|
|
$php ./sapphire/cli-script.php $1 $2
|
|
exit $?
|
|
fi
|
|
|
|
if [ -f ./cli-script.php ]; then
|
|
$php ./cli-script.php $1 $2
|
|
exit $?
|
|
fi
|
|
|
|
echo "Can't find ./sapphire/cli-script.php or ./cli-script.php"
|