From 728483015215f49d36b75097b58eda1a23b6ff7f Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sat, 22 Sep 2018 13:05:06 +0100 Subject: [PATCH] util: Fail silently when directory already exists 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 1be6dc14..31c16319 100644 --- a/src/functions/functions.util +++ b/src/functions/functions.util @@ -251,6 +251,11 @@ file_get_age() { make_directory() { local path="${1}" + # Exit silently when directory already exists + if [ -d "${path}" ]; then + return ${EXIT_OK} + fi + if ! mkdir -p "${path}"; then log ERROR "Could not create directory ${path}" return ${EXIT_ERROR} -- 2.47.2