tmp: Fix accidentally creating two directories
This commit is contained in:
parent
55c08e07f6
commit
e04df95faf
5
tmp
5
tmp
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user