From 731154ea8d232f614f32049eb420a85da0a323b1 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Mon, 3 Jun 2013 22:33:17 -0600 Subject: fix bugs with `set -u` in common.sh --- lib/common.sh | 6 +++--- 1 file 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() { -- cgit v1.2.3-70-g09d2