moved the recustomize alias into being a function, which allows it to support parameters.
authorFred T. Hamster <fred@gruntose.com>
Wed, 20 Mar 2013 01:38:23 +0000 (21:38 -0400)
committerFred T. Hamster <fred@gruntose.com>
Wed, 20 Mar 2013 01:38:23 +0000 (21:38 -0400)
now using that fact to allow other users to have customizations besides fred; their base
name just needs to be provided when calling the recustomize function, e.g.:
  recustomize simba

scripts/core/common.alias
scripts/core/functions.sh

index 44cf303cca84551dbff14aa8732f4312dcf770c4..77dee20a849eaf08cf0919de2583d24a8f007a48 100644 (file)
@@ -89,8 +89,6 @@ alias play='bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh'
 # says goodbye when leaving a shell.
 alias bye='. $FEISTY_MEOW_SCRIPTS/users/goodbye.sh'
 alias cputemp='acpi -t'
-# redoes fred's set of custom scripts.
-alias recustomize='regenerate >/dev/null; echo "copying custom overrides for fred..."; cpdiff $FEISTY_MEOW_DIR/customizing/fred $FEISTY_MEOW_GENERATED/custom; regenerate'
 # makes root user's home directory's permissions right.
 alias reroot='chown -R root:root /root'
 # yes, these are really helpful...
index aa9c512a918cfa91703226c4f77a1efe413b85d4..ae3fd1c173c139add14032b2a06eaa7d321fcdff 100644 (file)
@@ -264,6 +264,27 @@ if [ -z "$skip_all" ]; then
     echo
   }
 
+  # copies a set of custom scripts into the proper location for feisty meow
+  # to merge their functions and aliases with the standard set.
+  function recustomize()
+  {
+    user="$1"; shift
+    if [ -z "$user" ]; then
+      # use our default example user if there was no name provided.
+      user=fred
+    fi
+    if [ ! -d "$FEISTY_MEOW_DIR/customizing/$user" ]; then
+      echo "The customization folder provided for $user should be:"
+      echo "  '$FEISTY_MEOW_DIR/customizing/$user'"
+      echo "but that folder does not exist.  Skipping customization."
+      return 1
+    fi
+    regenerate >/dev/null
+    echo "copying custom overrides for $user"
+    perl "$FEISTY_MEOW_SCRIPTS/text/cpdiff.pl" "$FEISTY_MEOW_DIR/customizing/$user" "$FEISTY_MEOW_GENERATED/custom"
+    regenerate
+  }
+
   function function_sentinel() { return 0; }
   
   if [ ! -z "$SHELL_DEBUG" ]; then echo function definitions end....; fi