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
|
# Define variables
|
||||||
name="$(basename "$0" .sh)"
|
name="$(basename "$0" .sh)"
|
||||||
|
tmpdirtemplate="XXXXXX"
|
||||||
tmpdir="$(mktemp -d)"
|
tmpdir="$(mktemp -d)"
|
||||||
|
|
||||||
# Verify them
|
# Verify them
|
||||||
@ -50,7 +51,7 @@ EOF
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
# Copy in template directory
|
# Validate $1
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
# Source in XDG dirs, if they exist
|
# Source in XDG dirs, if they exist
|
||||||
userdirs="${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
|
userdirs="${XDG_CONFIG_HOME:-$HOME/.config}/user-dirs.dirs"
|
||||||
@ -68,6 +69,14 @@ if [ -n "$1" ]; then
|
|||||||
exit 4
|
exit 4
|
||||||
fi
|
fi
|
||||||
log "Using template \"$1\""
|
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"
|
cp -r "$copydir"/* "$tmpdir"
|
||||||
unset copydir
|
unset copydir
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user