Ensure that $TMPDIR exists if defined

This commit is contained in:
Eelco Dolstra 2022-08-17 21:47:01 +02:00
parent 6547dcde2a
commit 823e1017d8
1 changed files with 5 additions and 0 deletions

View File

@ -349,6 +349,11 @@ _sudo() {
}
# Ensure that $TMPDIR exists if defined.
if [[ -v TMPDIR ]]; then
mkdir -m 0700 -p "$TMPDIR"
fi
readonly SCRATCH=$(mktemp -d)
finish_cleanup() {
rm -rf "$SCRATCH"