Fixed environment issues

This commit is contained in:
2026-03-17 13:29:29 -05:00
parent 03df3fb462
commit 5d7ee6e00f
3 changed files with 13 additions and 5 deletions

View File

@@ -20,10 +20,13 @@ cat > "$POST_PUSH" << 'EOF'
#!/usr/bin/env bash
# post-push hook — sync markdown files to WikiJS after every push.
cd "$(git rev-parse --show-toplevel)"
if command -v python3 &>/dev/null; then
python3 tools/publish_docs.py || echo "[wikijs] publish failed — run manually: python3 tools/publish_docs.py"
PYTHON=$(command -v python3 2>/dev/null || command -v python 2>/dev/null || true)
if [[ -z "$PYTHON" ]]; then
echo "[wikijs] python not found — skipping doc sync"
elif ! "$PYTHON" -c "import requests" &>/dev/null; then
echo "[wikijs] requests not installed — skipping doc sync (run: $PYTHON -m pip install requests python-dotenv)"
else
echo "[wikijs] python3 not found — skipping doc sync"
"$PYTHON" tools/publish_docs.py || echo "[wikijs] publish failed — run manually: $PYTHON tools/publish_docs.py"
fi
EOF