summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2013-06-03 22:33:17 -0600
committerLuke Shumaker <LukeShu@sbcglobal.net>2013-06-03 22:33:17 -0600
commit731154ea8d232f614f32049eb420a85da0a323b1 (patch)
tree620314cedf0891e7c336c21b85277f6ef16672d7
parentd197eacf8b7aba0796a0f6ac6ac1667564bd614e (diff)
fix bugs with `set -u` in common.sh
-rw-r--r--lib/common.sh6
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() {