File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change 11#! /bin/bash
2- # Pre-push hook: build MkDocs locally and run LinkChecker
2+ # Pre-push hook: Custom linkchecker for local links, Build MkDocs locally and run LinkChecker on external links
3+
34set -e
45
56# === Paths ===
6- PROJECT_ROOT=" $( cd " $( dirname " $0 " ) " /.. && pwd ) "
7+ PROJECT_ROOT=" $( git rev-parse --show-toplevel ) "
78VENV_BIN=" $PROJECT_ROOT /venv/bin"
89TMP_BUILD_DIR=" $PROJECT_ROOT /.tmp-mkdocs-build"
910DOCS_DIR=" $PROJECT_ROOT /docs"
1011
12+ echo " PROJECT_ROOT=$PROJECT_ROOT "
13+ echo " DOCS_DIR=$DOCS_DIR "
14+ echo " VENV_BIN=$VENV_BIN "
15+ " $VENV_BIN /python" --version
16+
17+ # Activate venv if not already activated
18+ if [ -f " $VENV_BIN /activate" ]; then
19+ . " $VENV_BIN /activate"
20+ fi
21+
1122
1223# Checking internal links in markdown files only
1324echo " Checking internal links in markdown files..."
25+
1426set +e
1527# Using custom python script for internal link checking:
1628" $VENV_BIN /python" " $PROJECT_ROOT /checklinks.py" " $DOCS_DIR "
1729RESULT_INTERNAL=$?
30+
1831set -e
1932
2033if [ $RESULT_INTERNAL -ne 0 ]; then
You can’t perform that action at this time.
0 commit comments