e0183dea10e2811c9702cc4d89137189c7f43bba
[feisty_meow.git] / scripts / site_avenger / siteup.sh
1 #!/bin/bash
2
3 # Author: Kevin Wentworth
4 # Author: Chris Koeritz
5
6 # updates a site avenger app.
7
8 export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )"  # obtain the script's working directory.
9 source "$WORKDIR/shared_site_mgr.sh"
10
11 ############################
12
13 # main body of script.
14
15 # check for parameters.
16 app_dirname="$1"; shift
17 repo_name="$1"; shift
18
19 sep
20
21 check_application_dir "$APPLICATION_DIR"
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 "$APPLICATION_DIR"
27 else
28   test_app_folder "$APPLICATION_DIR" "$app_dirname"
29 fi
30
31 # where we expect to find our checkout folder underneath.
32 full_app_dir="$APPLICATION_DIR/$app_dirname"
33
34 # use our default values for the repository and theme if they're not provided.
35 if [ -z "$repo_name" ]; then
36   repo_name="$app_dirname"
37 fi
38
39 echo "Repository: $repo_name"
40 sep
41
42 # this should set the site_store_path variable if everything goes well.
43 update_repo "$full_app_dir" "$CHECKOUT_DIR_NAME" "$DEFAULT_REPOSITORY_ROOT" "$repo_name"
44 test_or_die "Updating the repository storage directory"
45
46 ####
47
48 sep
49
50 echo "Finished updating the site in ${app_dirname}."
51