From d06b89cda9fc161ebeae6feab42254e05b7355a9 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Fri, 23 Jun 2017 11:30:47 +0200
Subject: [PATCH] Fix missing server variable

---
 gitlab/functions.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gitlab/functions.sh b/gitlab/functions.sh
index a05dff2..5556c31 100644
--- a/gitlab/functions.sh
+++ b/gitlab/functions.sh
@@ -207,20 +207,20 @@ dav_delete() {
   log_info "curl: EXISTS ${1}?"
 
   # checks if the directory exists before trying to remove it (use --head)
-  local code=$(curl --location --silent --fail --write-out "%{http_code}" --head --user "${DOCUSER}:${DOCPASS}" "$1")
+  local code=$(curl --location --silent --fail --write-out "%{http_code}" --head --user "${DOCUSER}:${DOCPASS}" "${DOCSERVER}/$1")
   if [[ ${code} == *404 ]]; then
     log_info "Directory $1 does not exist. Skipping deletion"
     return 0
   fi
 
   log_info "curl: DELETE ${1}..."
-  code=$(curl --location --silent --fail --write-out "%{http_code}" --user "${DOCUSER}:${DOCPASS}" -X DELETE "$1")
+  code=$(curl --location --silent --fail --write-out "%{http_code}" --user "${DOCUSER}:${DOCPASS}" -X DELETE "${DOCSERVER}/$1")
 
   if [[ ${code} == *204 || ${code} == *201 ]]; then
     log_info "Successfully deleted ${1} with curl"
   else
     log_error "Curl command finished with an error condition (code=${code}):"
-    curl --location --silent --user "${DOCUSER}:${DOCPASS}" -X DELETE "$1"
+    curl --location --silent --user "${DOCUSER}:${DOCPASS}" -X DELETE "${DOCSERVER}/$1"
     exit "${code}"
   fi
 }
-- 
GitLab