TRAVIS: fix update-gh-pages.sh

This commit is contained in:
Julian Ospald 2016-06-01 15:34:30 +02:00
parent 741c510b91
commit 9f6734e700
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
1 changed files with 9 additions and 8 deletions

View File

@ -19,6 +19,13 @@ git config --global user.email "travis@travis-ci.org"
git config --global user.name "travis-ci"
git clone --branch=${TARGET_BRANCH} ${REPO} ${TARGET_BRANCH} || exit 1
# docs
cd ${TARGET_BRANCH} || exit 1
echo "Removing old docs."
rm -rf .
echo "Adding new docs."
cp -rf "${TRAVIS_BUILD_DIR}${DOC_LOCATION}"/* . || exit 1
# If there are no changes to the compiled out (e.g. this is a README update)
# then just bail.
if [ -z `git diff --exit-code` ]; then
@ -26,13 +33,7 @@ if [ -z `git diff --exit-code` ]; then
exit 0
fi
# docs
cd ${TARGET_BRANCH} || exit 1
echo "Removing old docs."
git rm -rf .
echo "Adding new docs."
cp -rf "${TRAVIS_BUILD_DIR}${DOC_LOCATION}"/* . || exit 1
git add *
git add -- .
if [[ -e ./index.html ]] ; then
echo "Commiting docs."
@ -45,7 +46,7 @@ auto-pushed to gh-pages"
git push origin $TARGET_BRANCH
echo "Published docs to gh-pages."
else
echo "Error docs are empty."
echo "Error: docs are empty."
exit 1
fi