summaryrefslogtreecommitdiffstats
path: root/helper
diff options
context:
space:
mode:
Diffstat (limited to 'helper')
-rw-r--r--helper/fileutil.inc1
1 files changed, 1 insertions, 0 deletions
diff --git a/helper/fileutil.inc b/helper/fileutil.inc
index 087a9a7f..1a5befbd 100644
--- a/helper/fileutil.inc
+++ b/helper/fileutil.inc
@@ -23,6 +23,7 @@ tarcopy () {
local SHORT=$FROM
[ ${#SHORT} -gt 23 ] && SHORT=$(echo "$SHORT" | cut -c-18)...$(echo "$SHORT" | cut -c$[${#SHORT} - 4]-)
[ -z "$TO" ] && perror "tarcopy called with empty destination."
+ [ ! -d "$TO" ] && { mkdir -p "$TO" || perror "could not create destination "$TO" for tar-copy."; }
tar -cp $FROM | tar -xp -C "$TO"
local PS=(${PIPESTATUS[*]})
[ "x${PS[0]}" != "x0" ] && perror "packing-part of tar-copy from '$SHORT' to '$TO' failed. (${PS[0]})"