From 057d3f6b9139e3d8eeafe642b5aeac6514a6df59 Mon Sep 17 00:00:00 2001 From: Timothy Willard <9395586+TimothyWillard@users.noreply.github.com> Date: Fri, 4 Oct 2024 09:06:43 -0400 Subject: [PATCH] Replace `exit 1` with `return` Swap is to avoid annoyingly closing a user's shell if there is an issue. The error message will still be the last line and user gets their shell back. --- build/hpc_install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/hpc_install.sh b/build/hpc_install.sh index 31b48e413..a10811f6d 100644 --- a/build/hpc_install.sh +++ b/build/hpc_install.sh @@ -26,13 +26,13 @@ elif [[ $1 == "rockfish" ]]; then module load git/2.42.0 else echo "The cluster name '$1' is not recognized, must be one of: 'longleaf', 'rockfish'." - exit 1 + return fi # Make sure the credentials is is where we expect and have the right perms if [ ! -f "$USERDIR/slack_credentials.sh" ]; then echo "You need to place sensitive credentials in '$USERDIR/slack_credentials.sh'." - exit 1 + return fi chmod 600 $USERDIR/slack_credentials.sh source $USERDIR/slack_credentials.sh @@ -49,7 +49,7 @@ if [ ! -d "$FLEPI_PATH" ]; then git clone git@github.com:HopkinsIDD/flepiMoP.git $FLEPI_PATH elif [ ! -d "$FLEPI_PATH/.git" ]; then echo "The flepiMoP found at '$FLEPI_PATH' is not a git clone, unsure of how to proceed." - exit 1 + return fi # Setup the conda environment @@ -82,11 +82,11 @@ WHICH_PYTHON_OKAY=$( echo "$WHICH_PYTHON" | grep "flepimop-env" | wc -l ) WHICH_R_OKAY=$( echo "$WHICH_R" | grep "flepimop-env" | wc -l ) if [[ "$WHICH_PYTHON_OKAY" -ne 1 ]]; then echo "The python found is '$WHICH_PYTHON', which does not contain the expected 'flepimop-env'." - exit 1 + return fi if [[ "$WHICH_R_OKAY" -ne 1 ]]; then echo "The R found is '$WHICH_R', which does not contain the expected 'flepimop-env'." - exit 1 + return fi PYTHON_ARROW_VERSION=$( python -c "import pyarrow; print(pyarrow.__version__)" ) R_ARROW_VERSION=$( Rscript -e "cat(as.character(packageVersion('arrow')))" )