summaryrefslogtreecommitdiff
path: root/misc/hooks
diff options
context:
space:
mode:
authorPouleyKetchoupp <pouleyketchoup@gmail.com>2020-03-30 23:02:38 +0200
committerPouleyKetchoupp <pouleyketchoup@gmail.com>2020-03-31 00:02:11 +0200
commit619354fb2c9dd046d37221a3a5041dda47135e3e (patch)
tree9fb80930734611f6814cc0363382488e12c14a70 /misc/hooks
parentb383484e445b1554c811556181a7815e0308fd62 (diff)
Fixed errors in makerst pre-commit hook
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