From 619354fb2c9dd046d37221a3a5041dda47135e3e Mon Sep 17 00:00:00 2001 From: PouleyKetchoupp Date: Mon, 30 Mar 2020 23:02:38 +0200 Subject: Fixed errors in makerst pre-commit hook --- misc/hooks/pre-commit-makerst | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'misc/hooks') 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 -- cgit v1.2.3