Skip to content

Instantly share code, notes, and snippets.

@svallory
Created July 11, 2012 05:39
Show Gist options
  • Save svallory/3088198 to your computer and use it in GitHub Desktop.
Save svallory/3088198 to your computer and use it in GitHub Desktop.
Yii-boilerplate command
#!/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