install: only create TMPDIR if missing

This commit is contained in:
Travis A. Everett 2022-08-19 15:03:37 -05:00
parent 823e1017d8
commit 0bf52b73f4

View file

@ -348,10 +348,9 @@ _sudo() {
fi
}
# Ensure that $TMPDIR exists if defined.
if [[ -v TMPDIR ]]; then
mkdir -m 0700 -p "$TMPDIR"
if [[ -n "${TMPDIR:-}" ]] && [[ ! -d "${TMPDIR:-}" ]]; then
mkdir -m 0700 -p "${TMPDIR:-}"
fi
readonly SCRATCH=$(mktemp -d)