Files
fulpstation/tools/hooks/python.sh
Tad Hardesty b4c330c24c Fix hook installation on Linux
Marks the shell scripts executable and sets nullglob so that the lack of
merge drivers doesn't cause shenanigans.
2018-01-30 16:55:37 -08:00

18 lines
363 B
Bash
Executable File

#!/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 "$@"