diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-04 14:50:17 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2016-01-04 14:50:17 +0200 |
commit | d644929fe62e1ecb178c1aea686d991ab1e97066 (patch) | |
tree | cbc1c247784f9211fef1f04bc2a555cbd7f1eda8 | |
parent | 95b9627f84decf1aa492554b4f972b0da2b114a4 (diff) |
Trap errors in bash functions
-rwxr-xr-x | dist | 1 | ||||
-rwxr-xr-x | install | 1 | ||||
-rwxr-xr-x | publish | 1 | ||||
-rwxr-xr-x | tag | 1 | ||||
-rwxr-xr-x | test | 1 |
5 files changed, 5 insertions, 0 deletions
@@ -11,6 +11,7 @@ usage="usage: $0 [-t]" owd=`pwd` trap "{ cd $owd; exit 1; }" ERR +set -o errtrace # Trap in functions. function info () { echo "$*" 1>&2; } function error () { info "$*"; exit 1; } @@ -35,6 +35,7 @@ usage="usage: $0 [options] <build2-toolchain-archive> <build2-repo>" owd=`pwd` trap "{ cd $owd; exit 1; }" ERR +set -o errtrace # Trap in functions. function info () { echo "$*" 1>&2; } function error () { info "$*"; exit 1; } @@ -8,6 +8,7 @@ usage="$0 [<rsync-options>]" owd=`pwd` trap "{ cd $owd; exit 1; }" ERR +set -o errtrace # Trap in functions. function info () { echo "$*" 1>&2; } function error () { info "$*"; exit 1; } @@ -11,6 +11,7 @@ usage="usage: $0 [-t]" owd=`pwd` trap "{ cd $owd; exit 1; }" ERR +set -o errtrace # Trap in functions. function info () { echo "$*" 1>&2; } function error () { info "$*"; exit 1; } @@ -8,6 +8,7 @@ usage="usage: $0" owd=`pwd` trap "{ cd $owd; exit 1; }" ERR +set -o errtrace # Trap in functions. function info () { echo "$*" 1>&2; } function error () { info "$*"; exit 1; } |