From 9a765945bd138e7c32b70c72a804641492177643 Mon Sep 17 00:00:00 2001 From: jaden <noreply@example.com> Date: Mon, 26 Jun 2017 18:40:32 +0200 Subject: [PATCH] move dav_mkdir out of subshell to properly capture error --- gitlab/functions.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/gitlab/functions.sh b/gitlab/functions.sh index c907e01..157c373 100644 --- a/gitlab/functions.sh +++ b/gitlab/functions.sh @@ -248,14 +248,9 @@ dav_recursive_mkdir() { log_info "mkdir $DOCSERVER/$current_subpath" # make sure the current subpath folder is created - local response # a 405 exit code is returned when the folder already exists - response=$(dav_mkdir "$DOCSERVER/$current_subpath" 405) - if [[ "${response}" == "405" ]]; then - log_info "Directory ${current_subpath} already exists." - else - log_info "Directory ${current_subpath} did not exist and was created." - fi + dav_mkdir "$DOCSERVER/$current_subpath" 405 + log_info "Directory ${current_subpath} (now) exists." done } -- GitLab