summaryrefslogtreecommitdiff
path: root/misc/hooks
diff options
context:
space:
mode:
Diffstat (limited to 'misc/hooks')
-rwxr-xr-xmisc/hooks/pre-commit-makerst9
1 files changed, 8 insertions, 1 deletions
diff --git a/misc/hooks/pre-commit-makerst b/misc/hooks/pre-commit-makerst
index d9b684e73b..b990788b99 100755
--- a/misc/hooks/pre-commit-makerst
+++ b/misc/hooks/pre-commit-makerst
@@ -2,4 +2,11 @@
# Git pre-commit hook that checks the class reference syntax using makerst.py.
-doc/tools/makerst.py doc/classes modules --dry-run
+# Workaround because we can't execute the .py file directly on windows
+PYTHON=python
+py_ver=$($PYTHON -c "import sys; print(sys.version_info.major)")
+if [[ "$py_ver" != "3" ]]; then
+ PYTHON+=3
+fi
+
+$PYTHON doc/tools/makerst.py doc/classes modules --dry-run