Created
March 13, 2011 20:03
-
-
Save tonyhb/868377 to your computer and use it in GitHub Desktop.
Kohana initialisation bash script: bash script for a new kohana 3 project (with git).
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/bash | |
if [[ $1 == '' ]]; then | |
echo -e "Which folder do you want to initialise the kohana project in?" | |
read -a dir | |
dir=${dir[@]} | |
else | |
dir=$@ | |
fi | |
if [ ! -d "$dir" ]; then | |
echo "Error: directory doesn't exist!" | |
exit 1 | |
fi | |
cd "$dir" | |
echo "Initialising repository..." | |
git init &> /dev/null | |
echo "Adding kohana core..." | |
git submodule add git://github.com/kohana/core.git system &> /dev/null | |
echo "Adding base files..." | |
mkdir {public_html,modules} | |
mkdir -p application/classes/{controller,model} | |
mkdir -p application/{config,views} | |
mkdir -m 0777 -p application/{cache,logs} | |
echo '[^.]*' > application/logs/.gitignore | |
echo '[^.]*' > application/cache/.gitignore | |
wget https://github.com/kohana/kohana/raw/3.1/master/index.php &> /dev/null | |
wget https://github.com/kohana/kohana/raw/3.1/master/application/bootstrap.php -O application/bootstrap.php &> /dev/null | |
echo "Project initialised." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment