1
mirror of https://github.com/streamlink/streamlink synced 2024-11-14 01:04:54 +01:00
streamlink/script/makedocs.sh
beardypig 5deb3413a8 docs: tweaks to docs and docs build process
Minor tweaks to the docs. Fixed all the warnings and enabled "Fail on warning" option so that problems with the docs will cause the build to fail on warning, the docs are also built for every commit and PR.
Restructured the travis script/after_success so that the docs are only pushed if the build was successful (only master branch and no PRs).
2017-01-16 11:52:14 +00:00

29 lines
679 B
Bash
Executable File

#!/usr/bin/env bash
# Execute this at the base of the streamlink repo.
if [ "$#" -ne 1 ] ; then
echo "Path to streamlink.github.io repo is required."
exit 1
fi
DOCS_REPO_PATH="$1"
pip install -r docs-requirements.txt
if make --directory=docs html ; then
# remove old files
rm "$DOCS_REPO_PATH/"*.html -f
rm "$DOCS_REPO_PATH/"*.js -f
rm "$DOCS_REPO_PATH/"*.inv -f
rm "$DOCS_REPO_PATH/_sources" -fr
rm "$DOCS_REPO_PATH/_static" -fr
# copy new files
cp -R docs/_build/html/* "$DOCS_REPO_PATH/"
echo "All the files were successfully built and copied."
exit 0
else
echo "An error occured during the docs' build."
exit 1
fi