mirror of
https://github.com/horizon-rust/horizon.git
synced 2026-11-07 02:56:17 -10:00
Git for Windows puts a Microsoft Store stub on PATH as python3: it prints "Python" and exits 49, so both hooks failed before running the check. The hooks now try python3, python and py and use the first that is Python 3. Co-Authored-By: Hermes Agent (Nous Research) <[email protected]>
12 lines
473 B
Bash
Executable File
12 lines
473 B
Bash
Executable File
#!/bin/sh
|
|
# Git for Windows puts a `python3` on PATH that is only the Microsoft Store
|
|
# stub: it prints "Python" and exits non-zero, so the hook fails with no other
|
|
# output. Use the first name that actually runs Python 3.
|
|
for py in python3 python py; do
|
|
if "$py" -c "import sys; sys.exit(sys.version_info < (3,))" >/dev/null 2>&1; then
|
|
exec "$py" tools/check_public_tree.py --pre-push
|
|
fi
|
|
done
|
|
echo "check_public_tree: no working Python 3 found" >&2
|
|
exit 1
|