New hooks folder

This commit is contained in:
Arokha Sieyes
2018-10-06 12:33:04 -04:00
parent dd7c6533a5
commit eaf45ccc08
6 changed files with 93 additions and 0 deletions

17
tools/hooks/python.sh Normal file
View File

@@ -0,0 +1,17 @@
#!/bin/bash
set -e
if command -v python3 >/dev/null 2>&1; then
PY=python3
else
PY=python
fi
PATHSEP=$($PY - <<'EOF'
import sys, os
if sys.version_info.major != 3 or sys.version_info.minor < 6:
sys.stderr.write("Python 3.6+ is required: " + sys.version + "\n")
exit(1)
print(os.pathsep)
EOF
)
export PYTHONPATH=tools/mapmerge2/${PATHSEP}${PYTHONPATH}
$PY "$@"