From: Chris Koeritz Date: Fri, 6 Dec 2013 18:04:58 +0000 (-0500) Subject: new function, and better approach for error handling. X-Git-Tag: 2.140.90~850 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=1809c04b7499a188d1c2a7df3ec588bc8591a2e3;p=feisty_meow.git new function, and better approach for error handling. --- diff --git a/scripts/buildor/build_xsedes.sh b/scripts/buildor/build_xsedes.sh index f51a0375..659965ec 100644 --- a/scripts/buildor/build_xsedes.sh +++ b/scripts/buildor/build_xsedes.sh @@ -2,6 +2,9 @@ source "$FEISTY_MEOW_SCRIPTS/core/functions.sh" +#hmmm: if this works well, we can use it in lots of places. +alias BAIL_ON_FAIL='if [ $? -ne 0 ]; then echo "A problem occurred. $msg"; return 1; fi' + function build_xsede() { if [ -z "$GENII_INSTALL_DIR" ]; then @@ -46,10 +49,22 @@ function rebuild_xsede() function rebu_bootstrap() { rebuild_xsede - check_result "failed to rebuild xsede code" + if [ $? -ne 0 ]; then echo "failed to rebuild xsede code"; return 1; fi bash $GENII_INSTALL_DIR/xsede_tools/library/bootstrap_quick_start.sh - check_result "failed to bootstrap a container" + if [ $? -ne 0 ]; then echo "failed to bootstrap a container"; return 1; fi + + success_sound +} + +# a shortcut for doing a quick build and then creating an installer. +function fast_install_build() +{ + build_xsede + if [ $? -ne 0 ]; then echo "failed to build xsede code"; return 1; fi + + bash $GENII_INSTALL_DIR/xsede_tools/tools/installer/fast_installer_build.sh $* + if [ $? -ne 0 ]; then echo "failed to create the installer."; return 1; fi success_sound }