From 150e53c4a797bc2c28832dc9c36535439cf6a457 Mon Sep 17 00:00:00 2001
From: jaden <noreply@example.com>
Date: Mon, 26 Jun 2017 17:06:27 +0200
Subject: [PATCH] mv mkdir -p webdav to before_docs.sh

---
 gitlab/before_docs.sh | 6 ++++++
 gitlab/functions.sh   | 8 +-------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/gitlab/before_docs.sh b/gitlab/before_docs.sh
index ca031af..71679c5 100755
--- a/gitlab/before_docs.sh
+++ b/gitlab/before_docs.sh
@@ -3,6 +3,12 @@
 
 source $(dirname ${0})/functions.sh
 
+# if the docs will be uploaded to at least one place,
+# make sure that the project folder will be available
+if [[ ${#DOC_UPLOADS[@]} -gt 0 ]]; then
+  dav_recursive_mkdir "${DOC_SERVER_PREFIX}"
+fi
+
 # Deletes all existing dav folders that will be overwritten
 for k in "${DOC_UPLOADS[@]}"; do
   dav_delete "${k}"
diff --git a/gitlab/functions.sh b/gitlab/functions.sh
index 2d7cccc..5205a4e 100644
--- a/gitlab/functions.sh
+++ b/gitlab/functions.sh
@@ -472,11 +472,5 @@ if [[ -n "${CI_COMMIT_TAG}" && "${IS_MASTER}" == "true" ]]; then
   DOC_UPLOADS+=("${DOC_SERVER_PREFIX}/stable/")
 fi
 
-# if the docs will be uploaded to at least one place,
-# make sure that the project folder will be available
-if [[ ${#DOC_UPLOADS[@]} -gt 0 ]]; then
-  dav_recursive_mkdir "${DOC_SERVER_PREFIX}"
-fi
-
-unset DOC_SERVER_PREFIX
+export_env DOC_SERVER_PREFIX
 check_env DOC_UPLOADS
-- 
GitLab