Skip to content

Commit b2844a6

Browse files
Built-in templates: make more strict by exit on error, error on unset variables, and fail a pipeline
1 parent 1e9f61e commit b2844a6

File tree

13 files changed

+73
-1
lines changed

13 files changed

+73
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: future.batchtools
2-
Version: 0.12.2-9972
2+
Version: 0.12.2-9973
33
Depends:
44
R (>= 3.2.0),
55
parallelly,

inst/templates/bash.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55
# Author: Henrik Bengtsson
66
######################################################################
77

8+
## Bash settings
9+
set -e # exit on error
10+
set -u # error on unset variables
11+
set -o pipefail # fail a pipeline if any command fails
12+
trap 'echo "Error on line $LINENO"; exit 1' ERR
13+
814
<%
915
## Maximum runtime?
1016
runtime <- resources[["timeout"]]

inst/templates/lsf.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
writeLines(job_declarations)
2929
%>
3030

31+
## Bash settings
32+
set -e # exit on error
33+
set -u # error on unset variables
34+
set -o pipefail # fail a pipeline if any command fails
35+
trap 'echo "Error on line $LINENO"; exit 1' ERR
36+
3137
echo "Batchtools information:"
3238
echo "- job name: '<%= job.name %>'"
3339
echo "- job log file: '<%= log.file %>'"

inst/templates/openlava.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
writeLines(job_declarations)
2929
%>
3030

31+
## Bash settings
32+
set -e # exit on error
33+
set -u # error on unset variables
34+
set -o pipefail # fail a pipeline if any command fails
35+
trap 'echo "Error on line $LINENO"; exit 1' ERR
36+
3137
echo "Batchtools information:"
3238
echo "- job name: '<%= job.name %>'"
3339
echo "- job log file: '<%= log.file %>'"

inst/templates/sge.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
writeLines(job_declarations)
3838
%>
3939

40+
## Bash settings
41+
set -e # exit on error
42+
set -u # error on unset variables
43+
set -o pipefail # fail a pipeline if any command fails
44+
trap 'echo "Error on line $LINENO"; exit 1' ERR
45+
4046
echo "Batchtools information:"
4147
echo "- job name: '<%= job.name %>'"
4248
echo "- job log file: '<%= log.file %>'"

inst/templates/slurm.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
writeLines(job_declarations)
2828
%>
2929

30+
## Bash settings
31+
set -e # exit on error
32+
set -u # error on unset variables
33+
set -o pipefail # fail a pipeline if any command fails
34+
trap 'echo "Error on line $LINENO"; exit 1' ERR
35+
3036
echo "Batchtools information:"
3137
echo "- job name: '<%= job.name %>'"
3238
echo "- job log file: '<%= log.file %>'"

inst/templates/torque.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@
3131
writeLines(job_declarations)
3232
%>
3333

34+
## Bash settings
35+
set -e # exit on error
36+
set -u # error on unset variables
37+
set -o pipefail # fail a pipeline if any command fails
38+
trap 'echo "Error on line $LINENO"; exit 1' ERR
39+
3440
echo "Batchtools information:"
3541
echo "- job name: '<%= job.name %>'"
3642
echo "- job log file: '<%= log.file %>'"

man/batchtools_bash.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/batchtools_lsf.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/batchtools_openlava.Rd

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)