comparison third_party/mercurial/hg.sh @ 249:c5129452493e

[deploy] Bundle Mercurial with hg-web Co-authored-by: Copilot <[email protected]>
author MrJuneJune <me@mrjunejune.com>
date Tue, 04 Aug 2026 04:16:45 -0700
parents
children
comparison
equal deleted inserted replaced
248:b8b6e726964a 249:c5129452493e
1 #!/bin/sh
2 set -eu
3
4 runtime_root="$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)"
5 python_binary="${PYTHON_BIN:-python3.11}"
6 if ! command -v "$python_binary" >/dev/null 2>&1; then
7 echo "Mercurial requires CPython 3.11: $python_binary was not found." >&2
8 exit 1
9 fi
10 if [ "$("$python_binary" -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')" != "3.11" ]; then
11 echo "Mercurial requires CPython 3.11." >&2
12 exit 1
13 fi
14 export PYTHONPATH="$runtime_root${PYTHONPATH:+:$PYTHONPATH}"
15 exec "$python_binary" -m mercurial "$@"