X-Git-Url: https://feistymeow.org/gitweb/?p=feisty_meow.git;a=blobdiff_plain;f=scripts%2Fcore%2Flaunch_feisty_meow.sh;fp=scripts%2Fcore%2Flaunch_feisty_meow.sh;h=80226899a83bad279656c1986bfc825ebc186775;hp=496786a71dcb6fbf6201068f93b6be4b34a591c8;hb=bd2cc8375efd80771088161ba31e41a521523c26;hpb=a089b6ec67065c080a3e582cb69468cf2be8b8b6 diff --git a/scripts/core/launch_feisty_meow.sh b/scripts/core/launch_feisty_meow.sh index 496786a7..80226899 100644 --- a/scripts/core/launch_feisty_meow.sh +++ b/scripts/core/launch_feisty_meow.sh @@ -18,12 +18,24 @@ ############## -ORIGINATING_FOLDER="$( \cd "$(\dirname "$0")" && /bin/pwd )" -CORE_SCRIPTS_DIR="$(echo "$ORIGINATING_FOLDER" | tr '\\\\' '/' )" -THIS_TOOL_NAME="$(basename "$0")" -# repair some paths that we should always be able to auto-calculate. -export FEISTY_MEOW_SCRIPTS="$( \cd "$CORE_SCRIPTS_DIR/.." && /bin/pwd )" -export FEISTY_MEOW_APEX="$( \cd "$FEISTY_MEOW_SCRIPTS/.." && /bin/pwd )" +# this script cannot handle figuring out where it lives, so approaches that +# get the WORKDIR will fail. this is a consequence of this always being used +# in bash's 'source' directive, which does not pass the script name as +# argument 0. instead, we just check for the bad condition of a malconfigured +# script system and try to repair it. + +# check if any crucial folder is hosed. we will torch the existing config +# to the extent we can. +if [ ! -d "$FEISTY_MEOW_SCRIPTS" -o ! -d "$FEISTY_MEOW_APEX" ]; then + # wipe out the offending variable(s). + unset FEISTY_MEOW_SCRIPTS FEISTY_MEOW_APEX + # clean out any unfortunate wrongness that may exist in our generated areas. + if [ -d "$"FEISTY_MEOW_LOADING_DOCK ]; then \rm -rf "$FEISTY_MEOW_LOADING_DOCK"; fi + if [ -d "$FEISTY_MEOW_GENERATED_STORE" ]; then \rm -rf "$FEISTY_MEOW_GENERATED_STORE"; fi + # also wipe any values from the variables pointing at generated stuff. + unset FEISTY_MEOW_LOADING_DOCK FEISTY_MEOW_GENERATED_STORE + exec "$*" +fi ##############