-if [ -z "$FEISTY_MEOW_GENERATED" ]; then
- # FEISTY_MEOW_GENERATED is where the generated files are located.
- # this is our single entry point we can use without knowing any variables
- # yet in the initialization process.
- export FEISTY_MEOW_GENERATED="$HOME/.zz_auto_gen"
-#hmmm: the above is kind of a constant. that's not so great.
-
- # make sure our main variables are established.
- GENERATED_FEISTY_MEOW_VARIABLES="$FEISTY_MEOW_GENERATED/fmc_variables.sh"
- if [ ! -f "$GENERATED_FEISTY_MEOW_VARIABLES" ]; then
- echo -e '\n\n'
- echo "Feisty meow scripts need initialization via the bootstrap process, e.g.:"
- echo " bash $HOME/feisty_meow/scripts/core/bootstrap_shells.sh"
- echo -e '\n\n'
- ERROR_OCCURRED=true
+echo "yodel; feisty apex=$FEISTY_MEOW_APEX; feisty scripts=$FEISTY_MEOW_SCRIPTS"
+
+# 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.
+
+# we start out thinking things are good.
+NO_REPAIRS_NEEDED=true
+
+# check if any crucial folder is hosed. we will torch the existing config
+# to the extent we can.
+if [ ! -d "$FEISTY_MEOW_APEX" ]; then
+ # flag some problems.
+ unset NO_REPAIRS_NEEDED
+ # 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
+ echo "
+
+The feisty meow configuration is damaged somehow. Please change to the
+directory where it is stored, e.g.:
+
+ cd /opt/feistymeow.org/feisty_meow
+
+and run this command (the whole unwieldy thing on multiple lines):
+
+echo pwd outside \$(pwd\) ;
+ exec bash -i 3<<EOF 4<&0 <&3
+echo pwd inside is \$(pwd\);
+ export FEISTY_MEOW_APEX=\"\$(pwd)\";
+ export FEISTY_MEOW_APEX=\$FEISTY_MEOW_APEX;
+ export FEISTY_MEOW_SCRIPTS=\$FEISTY_MEOW_APEX/scripts;
+ /bin/bash \$FEISTY_MEOW_APEX/scripts/core/reconfigure_feisty_meow.sh;
+ source \$FEISTY_MEOW_APEX/scripts/core/launch_feisty_meow.sh;
+ exec 3>&- <&4
+EOF
+
+Note that this assumes that the .bashrc file could still need editing to fix
+an erroneous FEISTY_MEOW_APEX variable, so we skip it above when bash runs.
+Check \$HOME/.bashrc to see if a change there will fix the problem.
+
+"
+else
+ # apex is good, so let's make the scripts good too.
+ if [ ! -d "$FEISTY_MEOW_SCRIPTS" ]; then
+ export FEISTY_MEOW_SCRIPTS="$FEISTY_MEOW_APEX/scripts"