Created
September 8, 2011 11:30
-
-
Save yuya-matsushima/1203193 to your computer and use it in GitHub Desktop.
CodeIgniterのsparksコマンドをラップしたscript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -e index.php ] && grep CodeIgniter index.php >/dev/null;then | |
#CI Project | |
if [ $# -eq 0 ]; then | |
if [ ! -d tools ] && [ ! -f tools/spark ];then | |
echo "Spark Manager is Not installed" | |
echo "Try 'setup'" | |
exit 1 | |
else | |
echo "Spark Manager need some parameters" | |
echo "Try 'help'" | |
exit 1 | |
fi | |
else | |
if [ ! -d tools ] && [ ! -f tools/spark ] && [ $1 != 'setup' ];then | |
echo "Spark Manager is Not installed" | |
echo "Try 'setup'" | |
exit 1 | |
else | |
if [ $1 = 'setup' ];then | |
if [ ! -d tools ] && [ ! -f tools/spark ];then | |
php -r "$(curl -fsSL http://getsparks.org/go-sparks)" | |
exit 0 | |
else | |
echo "Spark Manager is already installed" | |
exit 1 | |
fi | |
elif [ $1 = 'help' ] || [ $1 = '-h' ];then | |
echo "setup # Install Spark Manager" | |
php tools/spark help | |
exit 0 | |
elif [ $1 = '-v' ];then | |
php tools/spark version | |
else | |
php tools/spark $* | |
exit 0 | |
fi | |
fi | |
fi | |
else | |
#Not CI Project | |
echo "Please mv to CodeIgniter project root" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment