aa4af787bc32cb6de8f44de55afae1825d3f84b4
[feisty_meow.git] / scripts / site_avenger / avcoreup.sh
1 #!/bin/bash
2
3 # Author: Kevin Wentworth
4 # Author: Chris Koeritz
5
6 # updates just the site avenger core portion of an app.
7
8 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
9 source "$WORKDIR/shared_site_mgr.sh"
10
11 # get our defaults.
12 source "$WORKDIR/site_avenger.config"
13
14 ############################
15
16 # main body of script.
17
18 # check for parameters.
19 app_dirname="$1"; shift
20
21 sep
22
23 check_application_dir "$APPLICATION_DIR"
24
25 # find proper webroot where the site will be initialized.
26 if [ -z "$app_dirname" ]; then
27   # no dir was passed, so guess it.
28   find_app_folder "$APPLICATION_DIR"
29 else
30   test_app_folder "$APPLICATION_DIR" "$app_dirname"
31 fi
32
33 # where we expect to find our checkout folder underneath.
34 full_app_dir="$APPLICATION_DIR/$app_dirname"
35
36 # simplistic approach here; just go to the folder and pull the changes.
37
38 pushd "$full_app_dir" &>/dev/null
39 test_or_die "Changing to app path '$full_app_dir'"
40
41 dir="avenger5/vendor/siteavenger/avcore"
42 if [ ! -d $dir ]; then
43   echo "The application doesn't seem to use avcore: $full_app_dir"
44 else
45   pushd "$dir" &>/dev/null
46
47   git pull
48   test_or_die "Pulling git repo for avcore under '$full_app_dir'"
49
50   echo "Finished updating the avcore portion of site in ${app_dirname}."
51
52   popd &>/dev/null
53 fi
54
55 popd &>/dev/null
56
57 sep
58