improvements in organization of the aliases, still ongoing.
[feisty_meow.git] / scripts / core / unter_alia.sh
index 43c414cb5a26d1dc412db640f2cd218cf368ceb1..dbf788ff2cd79beb488392b030e781eb3e1e9c21 100644 (file)
@@ -1,16 +1,12 @@
 #!/bin/bash
 
-# generates alias files for different operating systems and shell scripts.
-# or really, mainly for bash these days, on linux.  but we also run under
-# msys and cygwin to some degree.
+# generates alias files for bash.
 #
 # The "common.alias" file is used in the generated aliases file as a base
-# set of generally useful aliases.  Shorter aliases based on any scripts
-# we can find in the feisty meow script hierarchy are added in as well.
-#
-# If any other alias files are found in the scripts/custom folder, they
-# are pulled in as additions and overrides for the basic feisty meow command
-# set.
+# set of generally useful aliases.  We also add aliases for any script files
+# (perl, bash, python, etc) that we find in the feisty meow script hierarchy.
+# Any *.alias files found in the $FEISTY_MEOW_GENERATED/custom folder are
+# loaded also.
 
 if [ ! -z "$SHELL_DEBUG" ]; then echo rebuiling generated aliases file...; fi
 
@@ -20,11 +16,14 @@ if [ ! -d $FEISTY_MEOW_GENERATED ]; then mkdir $FEISTY_MEOW_GENERATED; fi
 # test if we can use color in ls...
 test_color=$(ls --help 2>&1 | grep -i color)
 
+# the main one is our common alias set.
 ALIAS_DEFINITION_FILES=("$FEISTY_MEOW_SCRIPTS/core/common.alias")
+
 # if custom aliases files exist, add them to the list.
-for i in "$FEISTY_MEOW_SCRIPTS/custom/*.alias"; do
-echo adding $i
-  ALIAS_DEFINITION_FILES+=("$i")
+for i in "$FEISTY_MEOW_GENERATED/custom/*.alias"; do
+  if [ -f "$i" ]; then
+    ALIAS_DEFINITION_FILES+=("$i")
+  fi
 done
 echo "alias files:"
 for i in "${ALIAS_DEFINITION_FILES[@]}"; do
@@ -33,8 +32,8 @@ done
 
 # write the aliases for sh and bash scripts.
 
-GENERATED_ALIAS_FILE="$FEISTY_MEOW_GENERATED/aliases.sh"
-echo "writing $GENERATED_ALIAS_FILE..."
+GENERATED_ALIAS_FILE="$FEISTY_MEOW_GENERATED/fmc_core_and_custom_aliases.sh"
+echo "writing generated aliases in $GENERATED_ALIAS_FILE..."
 
 #hmmm: perhaps a good place for a function to create the header,
 #      given the appropriate comment code.