Skip to content

Instantly share code, notes, and snippets.

@tonyhb
Created March 13, 2011 20:03
Show Gist options
  • Save tonyhb/868377 to your computer and use it in GitHub Desktop.
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).
#! /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