X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcore%2Ffunctions.sh;h=c2f946a8c01ef8a160c0b6af2d737bb8957b0612;hb=3bcb83e182f35554308af3a73665a217859fc875;hp=a7babc220f641c8f818d65e66c5400a4b6e6caec;hpb=16afe4d6569a92127a4f27dfb36e0acc1889b392;p=feisty_meow.git diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index a7babc22..c2f946a8 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -4,7 +4,7 @@ # 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 @@ -357,12 +357,9 @@ if [ -z "$skip_all" ]; 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 &>/dev/null unset -f function_sentinel # reload feisty meow environment in current shell. source $FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh @@ -379,15 +376,15 @@ if [ -z "$skip_all" ]; then # use our default example user if there was no name provided. user=fred fi - if [ ! -d "$FEISTY_MEOW_APEX/customizing/$user" ]; then + if [ ! -d "$FEISTY_MEOW_APEX/customize/$user" ]; then echo "The customization folder provided for $user should be:" - echo " '$FEISTY_MEOW_APEX/customizing/$user'" + echo " '$FEISTY_MEOW_APEX/customize/$user'" echo "but that folder does not exist. Skipping customization." return 1 fi regenerate >/dev/null pushd "$FEISTY_MEOW_LOADING_DOCK/custom" &>/dev/null - incongruous_files="$(bash "$FEISTY_MEOW_SCRIPTS/files/list_non_dupes.sh" "$FEISTY_MEOW_APEX/customizing/$user" "$FEISTY_MEOW_LOADING_DOCK/custom")" + incongruous_files="$(bash "$FEISTY_MEOW_SCRIPTS/files/list_non_dupes.sh" "$FEISTY_MEOW_APEX/customize/$user" "$FEISTY_MEOW_LOADING_DOCK/custom")" #echo "the incongruous files list is: $incongruous_files" # disallow a single character result, since we get "*" as result when nothing exists yet. @@ -399,10 +396,10 @@ if [ -z "$skip_all" ]; then popd &>/dev/null echo "copying custom overrides for $user" mkdir -p "$FEISTY_MEOW_LOADING_DOCK/custom" 2>/dev/null - perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_APEX/customizing/$user" "$FEISTY_MEOW_LOADING_DOCK/custom" - if [ -d "$FEISTY_MEOW_APEX/customizing/$user/scripts" ]; then + perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_APEX/customize/$user" "$FEISTY_MEOW_LOADING_DOCK/custom" + if [ -d "$FEISTY_MEOW_APEX/customize/$user/scripts" ]; then echo "copying custom scripts for $user" - \cp -R "$FEISTY_MEOW_APEX/customizing/$user/scripts" "$FEISTY_MEOW_LOADING_DOCK/custom/" + \cp -R "$FEISTY_MEOW_APEX/customize/$user/scripts" "$FEISTY_MEOW_LOADING_DOCK/custom/" fi echo regenerate @@ -550,7 +547,9 @@ if [ -z "$skip_all" ]; then { local dir="$1"; shift pushd "$dir" &>/dev/null + if [ $? -ne 0 ]; then echo failed to enter dir--quitting.; fi rm -rf $* &>/dev/null + if [ $? -ne 0 ]; then echo received a failure code when removing.; fi popd &>/dev/null } @@ -665,7 +664,10 @@ return 0 ############## - function function_sentinel() { return 0; } + function function_sentinel() + { + return 0; + } if [ ! -z "$SHELL_DEBUG" ]; then echo "feisty meow function definitions done."; fi