forked from python-semantic-release/python-semantic-release
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwatch_docs.sh
More file actions
23 lines (17 loc) · 751 Bytes
/
Copy pathwatch_docs.sh
File metadata and controls
23 lines (17 loc) · 751 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
if command -v realpath >/dev/null 2>&1; then
PROJ_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")/..")
elif command -v readlink >/dev/null 2>&1; then
PROJ_ROOT=$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/..")
else
PROJ_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
fi
[ -z "$VIRTUAL_ENV" ] && VIRTUAL_ENV=".venv"
SPHINX_AUTOBUILD_EXE="$VIRTUAL_ENV/bin/sphinx-autobuild"
cd "$PROJ_ROOT" || exit 1
if [ ! -f "$SPHINX_AUTOBUILD_EXE" ]; then
printf '%s\n' "sphinx-autobuild is not installed in the virtual environment. Please install the docs extras."
exit 1
fi
rm -rf docs/_build/html docs/api/modules
exec "$SPHINX_AUTOBUILD_EXE" docs docs/_build/html --open-browser --port 9000 --ignore docs/api/modules