1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

Add check destdir exists

mkdir later is not creating parent directories and it is not desirable
to use `mkdir -p` which could lead to existing directory reuse.

So the parent directory should either exist or should be created.
This commit is contained in:
Marian Csontos 2015-06-04 11:31:24 +02:00
parent ce18fb61c0
commit e7b5c219ad

View File

@ -57,6 +57,8 @@ mkdtemp() {
destdir=$1
template=$2
test -d "$destdir" || die "DIR ('$destdir') does not exist."
case "$template" in
*XXXX) ;;
*) die "Invalid template: $template (must have a suffix of at least 4 X's)";;