From 2012c1b6a1216fe420827f834b853c732998e6e7 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 23 Sep 2018 15:27:41 +0200 Subject: [PATCH] copy: Automatically create target directory when copying files Fixes: #11663 Signed-off-by: Michael Tremer --- src/functions/functions.util | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/functions/functions.util b/src/functions/functions.util index 0201d028..58afa938 100644 --- a/src/functions/functions.util +++ b/src/functions/functions.util @@ -873,6 +873,11 @@ copy() { return ${EXIT_ERROR} fi + # Create destination directory if it doesn't exist, yet + if ! make_parent_directory "${dst}"; then + return ${EXIT_ERROR} + fi + if ! fread "${src}" > "${dst}"; then log ERROR "Could not copy data from ${src} to ${dst}" return ${EXIT_ERROR} -- 2.39.2