Skip to content

Commit

Permalink
Merge pull request #8 from henrykironde/fail_and_exit
Browse files Browse the repository at this point in the history
Ensure forced exit on errors
  • Loading branch information
henrykironde authored Jan 9, 2024
2 parents 240ebcc + a88f943 commit f775c37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion portal_dryrun_forecast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ git clone https://github.com/weecology/portal-forecasts.git
cd portal-forecasts

echo "INFO [$(date "+%Y-%m-%d %H:%M:%S")] Running Portal Forecasts"
singularity run ../portalcasting_latest.sif Rscript PortalForecasts_dryrun.R
singularity run ../portalcasting_latest.sif Rscript PortalForecasts_dryrun.R 2>&1 || exit 1

echo "INFO [$(date "+%Y-%m-%d %H:%M:%S")] Checking if forecasts were successful"
# Redirect stderr(2) to stdout(1) if command fails, and exit script with 1
Expand Down
2 changes: 1 addition & 1 deletion portal_weekly_forecast.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ git clone https://github.com/weecology/portal-forecasts.git
cd portal-forecasts

echo "INFO [$(date "+%Y-%m-%d %H:%M:%S")] Running Portal Forecasts"
singularity run ../portalcasting_latest.sif Rscript PortalForecasts.R
singularity run ../portalcasting_latest.sif Rscript PortalForecasts.R 2>&1 || exit 1

echo "INFO [$(date "+%Y-%m-%d %H:%M:%S")] Checking if forecasts were successful"
# Redirect stderr(2) to stdout(1) if command fails, and exit script with 1
Expand Down

0 comments on commit f775c37

Please sign in to comment.