Polish up tmp a bit more
This commit is contained in:
parent
74a38a5983
commit
4263f0404a
11
tmp
11
tmp
@ -8,6 +8,7 @@
|
||||
|
||||
# Define variables
|
||||
name="$(basename "$0" .sh)"
|
||||
tmpdirtemplate="XXXXXX"
|
||||
tmpdir="$(mktemp -d)"
|
||||
|
||||
# Verify them
|
||||
@ -50,7 +51,7 @@ EOF
|
||||
esac
|
||||
done
|
||||
|
||||
# Copy in template directory
|
||||
# Validate $1
|
||||
if [ -n "$1" ]; then
|
||||
# Source in XDG dirs, if they exist
|
||||
userdirs="${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
|
||||
@ -68,6 +69,14 @@ if [ -n "$1" ]; then
|
||||
exit 4
|
||||
fi
|
||||
log "Using template \"$1\""
|
||||
tmpdirtemplate="$1.$tmpdirtemplate"
|
||||
fi
|
||||
|
||||
# Make our directory
|
||||
tmpdir="$(mktemp -dt "tmp.$tmpdirtemplate")"
|
||||
|
||||
# Copy in template directory
|
||||
if [ -n "$1" ] && [ -n "$copydir" ] && [ -n "$tmpdir" ]; then
|
||||
cp -r "$copydir"/* "$tmpdir"
|
||||
unset copydir
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user