also fixed the variable, alias and function names used for sentinels to line up nicely, including a user customization sentinel.
# these are my personal overrides. --fred.
-if [ -z "$NETHACKOPTIONS" ]; then
+if [ -z "$USER_CUSTOMIZATIONS_LOADED" ]; then
# if we don't see the nethack variable defined, this probably hasn't run yet.
# The cloud directory is our new repository that's always available. It serves as our
# options for the lame mp3 encoder.
export LAMEOPT="--alt-preset extreme"
+ # customization sentinel can be set now.
+ export USER_CUSTOMIZATIONS_LOADED=true
fi
##############
-# set the sentinel variable that says this file was handled.
-export CORE_ALIASES_LOADED=true
+# set the sentinel alias that says this file was handled.
+alias CORE_ALIASES_LOADED=true
##############
# test whether we've been here before or not.
skip_all=
-function_sentinel &>/dev/null
+type function_sentinel &>/dev/null
if [ $? -eq 0 ]; then
# there was no error, so we can skip the inits.
if [ ! -z "$SHELL_DEBUG" ]; then
echo "regenerating feisty meow script environment."
bash $FEISTY_MEOW_SCRIPTS/core/reconfigure_feisty_meow.sh
echo
- # force a full reload by turning off sentinel variable and alias.
- # the nethack one is used by fred's customizations.
- # interesting note perhaps: found that the NETHACKOPTIONS variable was
- # not being unset correctly when preceded by an alias. split them up
- # like they are now due to that bug.
- unset -v CORE_ALIASES_LOADED FEISTY_MEOW_LOADING_DOCK NECHUNG NETHACKOPTIONS
+ # force a full reload by turning off sentinel variables and methods.
+ unset -v CORE_VARIABLES_LOADED FEISTY_MEOW_LOADING_DOCK USER_CUSTOMIZATIONS_LOADED
+ unalias CORE_ALIASES_LOADED
unset -f function_sentinel
# reload feisty meow environment in current shell.
source $FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh
##############
- function function_sentinel() { return 0; }
+ function function_sentinel()
+ {
+ return 0;
+ }
if [ ! -z "$SHELL_DEBUG" ]; then echo "feisty meow function definitions done."; fi
if [ ! -z "$SHELL_DEBUG" ]; then echo "heavyweight init begins..."; fi
# set up the aliases for the shell, but only if they are not already set.
- if [ -z "$CORE_ALIASES_LOADED" ]; then
+ type CORE_ALIASES_LOADED &>/dev/null
+ if [ $? -ne 0 ]; then
if [ ! -z "$SHELL_DEBUG" ]; then
echo "the aliases were missing, now they are being added..."
fi
##############
# we'll run this again only if we think it's needed.
-if [ -z "$NECHUNG" ]; then
+if [ -z "$CORE_VARIABLES_LOADED" ]; then
if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization begins...; fi
define_yeti_variable SHUNIT_DIR="$FEISTY_MEOW_SCRIPTS/shunit"
##############
+
+ define_yeti_variable CORE_VARIABLES_LOADED=true
if [ ! -z "$SHELL_DEBUG" ]; then echo variables initialization ends....; fi
fi
fi
source "$i"
done
-
+