From: Chris Koeritz Date: Sun, 12 Nov 2017 23:18:42 +0000 (-0500) Subject: close to right for loading aliases X-Git-Tag: 2.140.98^2~10 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=63904255387303a722bd6993bc1c517a2e8dc7d4;p=feisty_meow.git close to right for loading aliases a new approach had rearranged the order of alias creation, leading one bank of them to think they had already been loaded. now a finalizer file is used instead, and it is the last thing loaded in the alias creation sequence. --- diff --git a/scripts/core/common.alias b/scripts/core/common.alias index 7526c8a9..fae1b6c6 100644 --- a/scripts/core/common.alias +++ b/scripts/core/common.alias @@ -142,7 +142,7 @@ unalias feistyme &>/dev/null ############## # set the sentinel alias that says this file was handled. -alias CORE_ALIASES_LOADED=true +#alias CORE_ALIASES_LOADED=true ############## diff --git a/scripts/core/generate_aliases.pl b/scripts/core/generate_aliases.pl index ae7ea3e7..a9b77747 100644 --- a/scripts/core/generate_aliases.pl +++ b/scripts/core/generate_aliases.pl @@ -152,10 +152,14 @@ Please see http://feistymeow.org for more details.\n"; #really need to use better exit codes. } +############## + $FEISTY_MEOW_LOADING_DOCK =~ s/\\/\//g; $FEISTY_MEOW_SCRIPTS =~ s/\\/\//g; $FEISTY_MEOW_APEX =~ s/\\/\//g; +############## + # create our generated shells directory if it's not already there. if (! -d $FEISTY_MEOW_LOADING_DOCK) { mkdir $FEISTY_MEOW_LOADING_DOCK; @@ -168,10 +172,14 @@ if (-d $FEISTY_MEOW_BINARIES) { system("chmod -R u+x \"$FEISTY_MEOW_BINARIES\"/*"); } +############## + # generate the first set of alias files that are defined in the core # and custom scripts directories. &rebuild_script_aliases; +############## + # trash the old versions. unlink("$FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh"); @@ -179,6 +187,8 @@ if (length($DEBUG_FEISTY_MEOW)) { printf "writing $FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh...\n"; } +############## + # open the alias files to be created. open(she, ">> $FEISTY_MEOW_LOADING_DOCK/fmc_aliases_for_scripts.sh"); @@ -217,4 +227,18 @@ foreach $file (@shell_files) { close(she); +############## + +# prepare a finalizer chunk that is the last thing to load. + +open(she, ">> $FEISTY_MEOW_LOADING_DOCK/fmc_ending_sentinel.sh"); + +# write in our sentinel alias that says alias loading was handled. +print she "define_yeti_alias CORE_ALIASES_LOADED=true\n"; + +close(she); + +############## + 1; + diff --git a/scripts/core/launch_feisty_meow.sh b/scripts/core/launch_feisty_meow.sh index 3c3cd691..3a9344ef 100644 --- a/scripts/core/launch_feisty_meow.sh +++ b/scripts/core/launch_feisty_meow.sh @@ -122,15 +122,20 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then fi ############## + +echo POINT A if [ -z "$ERROR_OCCURRED" ]; then - + +echo POINT B # pull in our generated variables that are the minimal set we need to find # the rest of our resources. source "$FEISTY_MEOW_VARIABLES_LOADING_FILE" +echo POINT C # Set up the temporary directory. source "$FEISTY_MEOW_SCRIPTS/core/create_tempdir.sh" +echo POINT D fi fi @@ -139,11 +144,14 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then if [ -z "$ERROR_OCCURRED" ]; then +echo POINT E + # load the larger body of standard feisty meow variables into the environment. # we actually want this to always run also; it will decide what variables need # to be set again. source "$FEISTY_MEOW_SCRIPTS/core/variables.sh" +echo POINT F ############## # include helpful functions. we do this every time rather than making it part @@ -151,11 +159,14 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then # sub-shells in bash. source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" +echo POINT G # load some helper methods for the terminal which we'll use below. source "$FEISTY_MEOW_SCRIPTS/tty/terminal_titler.sh" +echo POINT H ############## +#hmmm: abstract this to a twiddle shell options method. # check hash table before searching path. shopt -s checkhash # don't check path for sourced files. @@ -168,6 +179,7 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then shopt -s checkwinsize ############## +echo POINT I # make history writes immediate to avoid losing history if bash is zapped. echo $PROMPT_COMMAND | grep -q history @@ -182,6 +194,7 @@ if [ "$NO_REPAIRS_NEEDED" == "true" ]; then if [ ! -z "$DEBUG_FEISTY_MEOW" ]; then echo "heavyweight init begins..."; fi +echo POINT J # set up the aliases for the shell, but only if they are not already set. type CORE_ALIASES_LOADED &>/dev/null if [ $? -ne 0 ]; then @@ -193,6 +206,7 @@ echo HEEE HAHAHAHAHA echo HOOOOEY fi +echo POINT K #echo before the new labelling, terminal titles have: #show_terminal_titles @@ -218,5 +232,8 @@ echo HOOOOEY unset FEISTY_MEOW_SHOW_LAUNCH_GREETING fi + # load the last bits we do here. + source "$FEISTY_MEOW_LOADING_DOCK/fmc_ending_sentinel.sh" + fi # "$NO_REPAIRS_NEEDED" was == "true"