removed a space so the command isn't hidden from history when copy/pasted.
[feisty_meow.git] / scripts / core / functions.sh
index ae3fd1c173c139add14032b2a06eaa7d321fcdff..1129d33669eb41800cb9609b64dce7bfbae39f1c 100644 (file)
@@ -32,7 +32,18 @@ if [ -z "$skip_all" ]; then
     if [ ! -d "$1" ]; then mkdir -p "$1"; fi
     cd "$1"
   }
-  
+
+  # 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.
+  function check_result()
+  {
+    if [ $? -ne 0 ]; then
+      echo -e "failed on: $*"
+      exit 1
+    fi
+  }
+
   # locates a process given a search pattern to match in the process list.
   function psfind() {
     local PID_DUMP="$(mktemp "$TMP/zz_pidlist.XXXXXX")"
@@ -240,7 +251,7 @@ if [ -z "$skip_all" ]; then
     if [ -z "$wheres_nechung" ]; then
       echo "The nechung oracle program cannot be found.  You may want to consider"
       echo "rebuilding the feisty meow applications with this command:"
-      echo "   bash $FEISTY_MEOW_SCRIPTS/generator/bootstrap_build.sh"
+      echo "bash $FEISTY_MEOW_SCRIPTS/generator/bootstrap_build.sh"
     else
       $wheres_nechung
     fi