diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-03 22:33:17 -0600 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2013-06-03 22:33:17 -0600 |
commit | 731154ea8d232f614f32049eb420a85da0a323b1 (patch) | |
tree | 620314cedf0891e7c336c21b85277f6ef16672d7 /lib | |
parent | d197eacf8b7aba0796a0f6ac6ac1667564bd614e (diff) | |
download | devtools-731154ea8d232f614f32049eb420a85da0a323b1.tar.xz |
fix bugs with `set -u` in common.sh
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/common.sh b/lib/common.sh index 7c0a9d3..4cf9944 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -59,17 +59,17 @@ stat_done() { _setup_workdir=false setup_workdir() { - [[ -z $WORKDIR ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX") + [[ -z ${WORKDIR:-} ]] && WORKDIR=$(mktemp -d --tmpdir "${0##*/}.XXXXXXXXXX") _setup_workdir=true trap 'trap_abort' INT QUIT TERM HUP trap 'trap_exit' EXIT } cleanup() { - if [[ -n $WORKDIR ]] && $_setup_workdir; then + if [[ -n ${WORKDIR:-} ]] && $_setup_workdir; then rm -rf "$WORKDIR" fi - [[ -n $1 ]] && exit $1 + [[ -n ${1:-} ]] && exit $1 } abort() { |