adding example apps, fixing powerup issues
[feisty_meow.git] / production / example_apps / zippy_maps / scripts / prepare_project.sh
1 #!/bin/bash
2
3 #hmmm: test this and make sure it's still right.
4 #hmmm: also test that it's inclusive of all the necessary steps for success.
5
6 #hmmm: aha, this is definitely missing the necessary link creations still.
7
8
9 # bails if any step fails.
10 function check_result() {
11   if [ $? -ne 0 ]; then
12     echo -e "failed on: $*"
13     error_sound
14     exit 1
15   fi
16 }
17
18 THIS_FOLDER="$( \cd "$(\dirname "$0")" && /bin/pwd )"
19 pushd $THIS_FOLDER/..
20
21 echo running composer update process...
22 composer update
23 check_result "updating project with composer"
24
25 echo -e "\n\nHave the two config files app.php and config_google.php been configured yet AND has the database for the app been added to mysql? (y/N)"
26 read line
27
28 if [ $line != 'y' -a $line != 'Y' -a $line != 'yes' -a $line != 'YES' ]; then
29   echo "Please configure the two config files using their default versions as templates (see the config directory for app.default.php and config_google.default.php)"
30   exit 1
31 fi
32
33 echo running migration code to build the database...
34 ./bin/cake migrations migrate
35 check_result "running the database migrations"
36
37 echo making asset symlinks
38 ./bin/cake plugin assets symlink
39 check_result "symlinking web assets"
40
41
42