From: Chris Koeritz Date: Thu, 9 Nov 2017 21:16:17 +0000 (-0500) Subject: refactored to make next refactoring easier X-Git-Tag: 2.140.90~13 X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=commitdiff_plain;h=306dbab38a3af18dac7e13c8e476cf0a95d78c76 refactored to make next refactoring easier moved to a more cosmopolitan model for the configuration. we will now load the site avenger config as a default if there is no config file specified. --- diff --git a/scripts/site_avenger/avcoreup.sh b/scripts/site_avenger/avcoreup.sh index aa4af787..0aeae721 100644 --- a/scripts/site_avenger/avcoreup.sh +++ b/scripts/site_avenger/avcoreup.sh @@ -8,9 +8,6 @@ export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. source "$WORKDIR/shared_site_mgr.sh" -# get our defaults. -source "$WORKDIR/site_avenger.config" - ############################ # main body of script. diff --git a/scripts/site_avenger/configs/default-site_avenger.config b/scripts/site_avenger/configs/default-site_avenger.config new file mode 100644 index 00000000..b5467dc6 --- /dev/null +++ b/scripts/site_avenger/configs/default-site_avenger.config @@ -0,0 +1,8 @@ + +# this script provides the default values for the variables used in our site management scripts. + +APPLICATION_DIR="$HOME/apps" +DEFAULT_REPOSITORY_ROOT="git@github.com:kwentworth" +CHECKOUT_DIR_NAME="avenger5" + + diff --git a/scripts/site_avenger/powerup.sh b/scripts/site_avenger/powerup.sh index aa1c4425..60c27783 100644 --- a/scripts/site_avenger/powerup.sh +++ b/scripts/site_avenger/powerup.sh @@ -25,9 +25,6 @@ export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. source "$WORKDIR/shared_site_mgr.sh" -# get our defaults. -source "$WORKDIR/site_avenger.config" - ############################ function print_instructions() diff --git a/scripts/site_avenger/shared_site_mgr.sh b/scripts/site_avenger/shared_site_mgr.sh index 8b18814c..41b033fe 100644 --- a/scripts/site_avenger/shared_site_mgr.sh +++ b/scripts/site_avenger/shared_site_mgr.sh @@ -5,8 +5,20 @@ # This contains a bunch of reusable functions that help out in managing websites. +# This script is sourced, and relies on the value of WORKDIR, which should +# point at the directory where the site management scripts are stored, +# especially this one. + source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" +# get our configuration loaded. +export SITE_MANAGEMENT_CONFIG_FILE +if [ -z "$SITE_MANAGEMENT_CONFIG_FILE" ]; then + SITE_MANAGEMENT_CONFIG_FILE="$WORKDIR/configs/default-site_avenger.config" +fi +source "$SITE_MANAGEMENT_CONFIG_FILE" +test_or_die "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE" + # configure feisty revision control to ignore vendor folders. export NO_CHECKIN_VENDOR=true diff --git a/scripts/site_avenger/site_avenger.config b/scripts/site_avenger/site_avenger.config deleted file mode 100644 index b5467dc6..00000000 --- a/scripts/site_avenger/site_avenger.config +++ /dev/null @@ -1,8 +0,0 @@ - -# this script provides the default values for the variables used in our site management scripts. - -APPLICATION_DIR="$HOME/apps" -DEFAULT_REPOSITORY_ROOT="git@github.com:kwentworth" -CHECKOUT_DIR_NAME="avenger5" - - diff --git a/scripts/site_avenger/sitepush.sh b/scripts/site_avenger/sitepush.sh index 96358692..22574e27 100644 --- a/scripts/site_avenger/sitepush.sh +++ b/scripts/site_avenger/sitepush.sh @@ -8,9 +8,6 @@ export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. source "$WORKDIR/shared_site_mgr.sh" -# get our defaults. -source "$WORKDIR/site_avenger.config" - ############################ # main body of script. diff --git a/scripts/site_avenger/siteup.sh b/scripts/site_avenger/siteup.sh index c9b348c4..e0183dea 100644 --- a/scripts/site_avenger/siteup.sh +++ b/scripts/site_avenger/siteup.sh @@ -8,9 +8,6 @@ export WORKDIR="$( \cd "$(\dirname "$0")" && \pwd )" # obtain the script's working directory. source "$WORKDIR/shared_site_mgr.sh" -# get our defaults. -source "$WORKDIR/site_avenger.config" - ############################ # main body of script.