Updates for hooks
This commit is contained in:
@@ -19,17 +19,12 @@ POST_PUSH="$HOOKS_DIR/post-push"
|
||||
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)"
|
||||
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
|
||||
"$PYTHON" tools/publish_docs.py || echo "[wikijs] publish failed — run manually: $PYTHON tools/publish_docs.py"
|
||||
fi
|
||||
REPO=$(git rev-parse --show-toplevel)
|
||||
powershell.exe -NoProfile -NonInteractive -Command "
|
||||
Set-Location '$REPO'
|
||||
python tools/publish_docs.py
|
||||
" || echo "[wikijs] publish failed — run manually: python tools/publish_docs.py"
|
||||
EOF
|
||||
|
||||
chmod +x "$POST_PUSH"
|
||||
echo " Installed post-push hook → $POST_PUSH"
|
||||
|
||||
Reference in New Issue
Block a user