Created
November 19, 2010 23:26
-
-
Save badsyntax/707402 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env bash | |
| # | |
| # build a new kohana3 project using the kohana3-examples repository | |
| # https://github.com/badsyntax/kohana3-examples | |
| if ! builtin type -p git > /dev/null ; then | |
| echo git doesn\'t appear to be installed.; exit 1 | |
| fi | |
| create_project(){ | |
| echo -n "Project path: " | |
| read PROJECT_PATH | |
| echo "Cloning repository..." | |
| git clone git://github.com/badsyntax/kohana3-examples.git $PROJECT_PATH | |
| cd $PROJECT_PATH | |
| echo -ne "\nCreating directories..." | |
| mkdir -p application/cache | |
| sudo chmod 777 application/cache | |
| mkdir -p application/logs | |
| sudo chmod 777 application/logs | |
| echo "done." | |
| echo -e "\nUpdating submodules, this will take some time...\n" | |
| git submodule update --init | |
| } | |
| create_database(){ | |
| echo -n "Create project database? y/n: " | |
| read CREATE_DATABASE | |
| if [ "${CREATE_DATABASE}" != 'y' ]; then | |
| exit 1; | |
| fi | |
| echo -n "Database type? mysql/postgres: " | |
| read DATABASE_TYPE | |
| cd application/build/ | |
| if [ "${DATABASE_TYPE}" == "mysql" ]; then | |
| ./build_mysql.sh | |
| elif [ "${DATABASE_TYPE}" == "postgres" ]; then | |
| ./build_postgres.sh | |
| else | |
| exit 1 | |
| fi | |
| } | |
| create_project | |
| create_database |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment