4478e12f92
Sphinx 1.8 introduced [1] the '--keep-going' argument which, as its name suggests, keeps the build running when it encounters non-fatal errors. This is exceptionally useful in avoiding a continuous edit-build loop when undertaking large doc reworks where multiple errors may be introduced. [1] https://github.com/sphinx-doc/sphinx/commit/e3483e9b045 Change-Id: Icfd0be4aff2de88346cfe380c29f28d16538733c
28 lines
613 B
Bash
Executable File
28 lines
613 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
rm -rf releasenotes/build
|
|
|
|
sphinx-build -a -E -W --keep-going \
|
|
-d releasenotes/build/doctrees \
|
|
-b html \
|
|
releasenotes/source releasenotes/build/html
|
|
BUILD_RESULT=$?
|
|
|
|
UNCOMMITTED_NOTES=$(git status --porcelain | \
|
|
awk '$1 == "M" && $2 ~ /releasenotes\/notes/ {print $2}')
|
|
|
|
if [ "${UNCOMMITTED_NOTES}" ]; then
|
|
cat <<EOF
|
|
|
|
REMINDER: The following changes to release notes have not been committed:
|
|
|
|
${UNCOMMITTED_NOTES}
|
|
|
|
While that may be intentional, keep in mind that release notes are built from
|
|
committed changes, not the working directory.
|
|
|
|
EOF
|
|
fi
|
|
|
|
exit ${BUILD_RESULT}
|