-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild-docs.sh
More file actions
executable file
·27 lines (21 loc) · 861 Bytes
/
build-docs.sh
File metadata and controls
executable file
·27 lines (21 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
# This script is used to build the documentation (for the vercel hosted website)
# Thus I didn't bother setting up stuff like venv here ;)
# Switch to the directory of this file
cd "$( dirname "${BASH_SOURCE[0]}" )" || exit
# Even Vercel needs venvs now, since otherwise pip will not work
python3 -m venv venv
source venv/bin/activate
# install the dependencies
python3 -m pip install poetry
python3 -m poetry install
if [[ -n "$DEPLOY_STABLE" ]]; then
echo "[*] Downloading latest released version of this plugin"
python3 -m poetry run pip install --force-reinstall --no-deps --upgrade mkdocs-badges
fi
# Vercel prefers outputs to be in public/
python3 -m poetry run mkdocs build -d public
if [[ -n "$1" ]]; then
echo "[*] Starting web server on 127.0.0.1:$1"
python3 -m http.server --bind 127.0.0.1 --directory public "$1"
fi