From 306dbab38a3af18dac7e13c8e476cf0a95d78c76 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Thu, 9 Nov 2017 16:16:17 -0500 Subject: [PATCH] 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. --- scripts/site_avenger/avcoreup.sh | 3 --- .../default-site_avenger.config} | 0 scripts/site_avenger/powerup.sh | 3 --- scripts/site_avenger/shared_site_mgr.sh | 12 ++++++++++++ scripts/site_avenger/sitepush.sh | 3 --- scripts/site_avenger/siteup.sh | 3 --- 6 files changed, 12 insertions(+), 12 deletions(-) rename scripts/site_avenger/{site_avenger.config => configs/default-site_avenger.config} (100%) 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/site_avenger.config b/scripts/site_avenger/configs/default-site_avenger.config similarity index 100% rename from scripts/site_avenger/site_avenger.config rename to scripts/site_avenger/configs/default-site_avenger.config 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/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. -- 2.34.1