tmp: Fix accidentally creating two directories

This commit is contained in:
Salt 2020-12-21 01:50:49 -06:00
parent 55c08e07f6
commit e04df95faf

5
tmp
View File

@ -9,10 +9,6 @@
# Define variables
name="$(basename "$0" .sh)"
tmpdirtemplate="XXXXXX"
tmpdir="$(mktemp -d)"
# Verify them
[ -z "$tmpdir" ] && exit 2
# Define functions
log() {
@ -74,6 +70,7 @@ fi
# Make our directory
tmpdir="$(mktemp -dt "tmp.$tmpdirtemplate")"
[ -z "$tmpdir" ] && exit 2
# Copy in template directory
if [ -n "$1" ] && [ -n "$copydir" ] && [ -n "$tmpdir" ]; then