tasty change to add a new category. this is definitely still a fred-realm script...
[feisty_meow.git] / scripts / core / functions.sh
index bf92636caaf113568aa1949c62b8e1a75e7f446b..6d2bbe29aba4f4f15193e4e53505db6a2a4d26f0 100644 (file)
@@ -33,6 +33,20 @@ if [ -z "$skip_all" ]; then
     cd "$1"
   }
 
+  function success_sound()
+  {
+    if [ ! -z "$CLAM_FINISH_SOUND" ]; then
+      bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh "$CLAM_FINISH_SOUND"
+    fi
+  }
+
+  function error_sound()
+  {
+    if [ ! -z "$CLAM_ERROR_SOUND" ]; then
+      bash $FEISTY_MEOW_SCRIPTS/multimedia/sound_play.sh "$CLAM_ERROR_SOUND"
+    fi
+  }
+
   # checks the result of the last command that was run, and if it failed,
   # then this complains and exits from bash.  the function parameters are
   # used as the message to print as a complaint.
@@ -40,6 +54,7 @@ if [ -z "$skip_all" ]; then
   {
     if [ $? -ne 0 ]; then
       echo -e "failed on: $*"
+      error_sound
       exit 1
     fi
   }
@@ -342,6 +357,8 @@ if [ -z "$skip_all" ]; then
     sed -i -e "s%$pattern%$replacement%g" "$file"
   }
 
+  ##############
+
   function function_sentinel() { return 0; }
   
   if [ ! -z "$SHELL_DEBUG" ]; then echo function definitions end....; fi