X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fsite_avenger%2Fshared_site_mgr.sh;h=6f731e6937a3158e83e4b994306ea985e366a2cb;hb=f8c8e666cc22c5cc3a18311ee8f534becfa23ca7;hp=27b03b9a75454caa4a21aa7008aa45c9e41e6fda;hpb=ddccfd5fd9f54b9b29382a72d9334e8c35698b3f;p=feisty_meow.git diff --git a/scripts/site_avenger/shared_site_mgr.sh b/scripts/site_avenger/shared_site_mgr.sh index 27b03b9a..6f731e69 100644 --- a/scripts/site_avenger/shared_site_mgr.sh +++ b/scripts/site_avenger/shared_site_mgr.sh @@ -381,4 +381,27 @@ function fix_appdir_ownership() fix_site_perms "$combo" } +# Jumps to an application directory given the app name. If no app name is +# given, it will show a menu to pick the app. +function switch_to() +{ + # check for parameters. + app_dirname="$1"; shift + + check_application_dir "$BASE_APPLICATION_PATH" + + # find proper webroot where the site will be initialized. + if [ -z "$app_dirname" ]; then + # no dir was passed, so guess it. + find_app_folder "$BASE_APPLICATION_PATH" + else + test_app_folder "$BASE_APPLICATION_PATH" "$app_dirname" + fi + + # where we expect to find our checkout folder underneath. + full_app_dir="$BASE_APPLICATION_PATH/$app_dirname" + + cd $full_app_dir/$CHECKOUT_DIR_NAME + pwd +}