Merge pull request #2 from abathur/tmp-slash

install: only create $TMPDIR if missing
This commit is contained in:
Eelco Dolstra 2022-08-22 12:07:38 +02:00 committed by GitHub
commit 380bf60c2e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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)