Created
July 11, 2012 05:39
-
-
Save svallory/3088198 to your computer and use it in GitHub Desktop.
Yii-boilerplate command
This file contains 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 | |
repo="https://github.com/theblacksmith/yii-boilerplate.git" | |
project="" | |
template="" | |
function usage | |
{ | |
echo "\nYii-boilerplate (by theblacksmith)\n\n" | |
echo "Usage:" | |
echo " yiib TEMPLATE PROJECT_NAME\n\n" | |
echo "Available templates" | |
echo " master" | |
echo " haml" | |
echo " bootstrap" | |
} | |
function create_project | |
{ | |
echo "Creating project directory" | |
mkdir $project | |
echo "Cloning template" | |
git clone -b $template --recursive $repo $project | |
echo "Removing the origin" | |
cd $project | |
git remote rm origin | |
git branch -m $template master | |
cd .. | |
echo "done!" | |
echo "NOTE! Go to $project/index.php and edit you yii framework location" | |
} | |
if [ $# = 2 ]; then | |
template=$1 | |
project=$2 | |
create_project | |
else | |
usage | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment