X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fcore%2Ffunctions.sh;h=1129d33669eb41800cb9609b64dce7bfbae39f1c;hb=51811434f90d0a757eaefe9c748e33feb1213191;hp=ae3fd1c173c139add14032b2a06eaa7d321fcdff;hpb=90e83971e52add3464e459f532df766247baaf93;p=feisty_meow.git diff --git a/scripts/core/functions.sh b/scripts/core/functions.sh index ae3fd1c1..1129d336 100644 --- a/scripts/core/functions.sh +++ b/scripts/core/functions.sh @@ -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