From e7b5c219ad9c2638626b772ee0706729035b7371 Mon Sep 17 00:00:00 2001 From: Marian Csontos Date: Thu, 4 Jun 2015 11:31:24 +0200 Subject: [PATCH] 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. --- test/lib/utils.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/lib/utils.sh b/test/lib/utils.sh index fe7ccd3bc..24c9076d4 100644 --- a/test/lib/utils.sh +++ b/test/lib/utils.sh @@ -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)";;