-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsync-docs.sh
More file actions
executable file
·49 lines (41 loc) · 2.9 KB
/
sync-docs.sh
File metadata and controls
executable file
·49 lines (41 loc) · 2.9 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env bash
set -euo pipefail
# ——————————————————————————————————————————————————————————————
# Load .env and export all variables
# ——————————————————————————————————————————————————————————————
if [[ -f .env ]]; then
# export all vars in .env (skipping blank lines and comments)
set -o allexport
# shellcheck disable=SC1091
source .env
set +o allexport
else
echo "❌ .env file not found in $(pwd)"
exit 1
fi
# ——————————————————————————————————————————————————————————————
# Variables we expect from .env:
# DOCS_SOURCE e.g. docs/_build/html
# WHEEL_HTML_INDEX_COMPATIBLE e.g. wheel-html-index
# ——————————————————————————————————————————————————————————————
: "${DOCS_SOURCE:?Need to set DOCS_SOURCE in .env}"
: "${WHEEL_HTML_INDEX_COMPATIBLE:?Need to set WHEEL_HTML_INDEX_COMPATIBLE in .env}"
# ——————————————————————————————————————————————————————————————
# 1. Clean out old docs (And create .nojekyll)
# ——————————————————————————————————————————————————————————————
echo "🧹 Cleaning docs/…"
rm -rf docs
mkdir -p docs
touch docs/.nojekyll
# ——————————————————————————————————————————————————————————————
# 2. Copy generated Sphinx HTML
# ——————————————————————————————————————————————————————————————
echo "📖 Copying Sphinx output from ${DOCS_SOURCE} → docs/"
cp -a "${DOCS_SOURCE}/." docs/
# # ——————————————————————————————————————————————————————————————
# # 3. Copy release/ into docs/${WHEEL_HTML_INDEX_COMPATIBLE}/
# # ——————————————————————————————————————————————————————————————
TARGET="docs"
echo "📦 Copying wheel-html-index docs/ → ${TARGET}/"
cp -a ./wheel-html-index "${TARGET}/"
echo "✅ Done! Your docs/ folder is now up-to-date."