2ae511cbb8eb50148b9efd2841ee0bddf088463e
[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
10 ############################
11
12 # main body of script.
13
14 # check for parameters.
15 app_dirname="$1"; shift
16
17 source "$WORKDIR/shared_site_mgr.sh"
18
19 sep
20
21 check_application_dir "$BASE_APPLICATION_PATH"
22
23 # find proper webroot where the site will be initialized.
24 if [ -z "$app_dirname" ]; then
25   # no dir was passed, so guess it.
26   find_app_folder "$BASE_APPLICATION_PATH"
27 else
28   test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname"
29 fi
30
31 # where we expect to find our checkout folder underneath.
32 full_app_dir="$BASE_APPLICATION_PATH/$app_dirname"
33
34 # simplistic approach here; just go to the folder and pull the changes.
35
36 pushd "$full_app_dir" &>/dev/null
37 test_or_die "Changing to app path '$full_app_dir'"
38
39 dir="avenger5/vendor/siteavenger/avcore"
40 if [ ! -d $dir ]; then
41   echo "The application doesn't seem to use avcore: $full_app_dir"
42 else
43   pushd "$dir" &>/dev/null
44
45   git pull
46   test_or_die "Pulling git repo for avcore under '$full_app_dir'"
47
48   echo "Finished updating the avcore portion of site in ${app_dirname}."
49
50   popd &>/dev/null
51 fi
52
53 popd &>/dev/null
54
55 sep
56