From 9457bd1a47f3a6a96bfbadc7249f6fe70255e9e4 Mon Sep 17 00:00:00 2001
From: Andre Anjos <andre.anjos@idiap.ch>
Date: Thu, 22 Sep 2016 10:03:46 +0200
Subject: [PATCH] [ci-pypi] Only build docs if a 'doc' directory exists

---
 ci/pypi.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/ci/pypi.sh b/ci/pypi.sh
index 471937e..1695f9a 100755
--- a/ci/pypi.sh
+++ b/ci/pypi.sh
@@ -56,10 +56,12 @@ green_echo "[>>] Uploading first to ${TESTSERVER} on behalf of ${PYPIUSER}..."
 setup check sdist --formats zip upload --repository staging
 green_echo "[<<] Test finished, proceeding..."
 
-# if that worked, uploads documentation to pythonhosted
-green_echo "[>>] Uploading documentation on behalf of ${PYPIUSER}..."
-setup upload_docs --upload-dir sphinx
-green_echo "[<<] Documentation uploaded, proceeding..."
+# if that worked, uploads documentation to pythonhosted if any exists
+if [ -d doc ]; then
+  green_echo "[>>] Uploading documentation on behalf of ${PYPIUSER}..."
+  setup upload_docs --upload-dir sphinx
+  green_echo "[<<] Documentation uploaded, proceeding..."
+fi
 
 # if that worked, uploads source package to the production index
 green_echo "[>>] Uploading package to ${PYPISERVER} on behalf of ${PYPIUSER}..."
-- 
GitLab