Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Roland Tannous
bd9103c113 fix(setup.sh): split python version pipeline for macOS compatibility
On macOS, if a python candidate's --version fails inside a pipeline,
set -euo pipefail can cause the script to exit instead of continuing
to the next candidate. Split the single pipeline into two commands so
that '|| continue' properly guards the version check.
2026-03-17 04:43:07 +00:00

View file

@ -172,7 +172,8 @@ for candidate in $(compgen -c python3 2>/dev/null | grep -E '^python3(\.[0-9]+)?
continue continue
fi fi
# Get version string, e.g. "Python 3.12.5" # Get version string, e.g. "Python 3.12.5"
ver_str=$("$candidate" --version 2>&1 | awk '{print $2}') ver_str=$("$candidate" --version 2>&1) || continue
ver_str=$(echo "$ver_str" | awk '{print $2}')
py_major=$(echo "$ver_str" | cut -d. -f1) py_major=$(echo "$ver_str" | cut -d. -f1)
py_minor=$(echo "$ver_str" | cut -d. -f2) py_minor=$(echo "$ver_str" | cut -d. -f2)
@ -198,7 +199,7 @@ for candidate in $(compgen -c python3 2>/dev/null | grep -E '^python3(\.[0-9]+)?
BEST_MINOR="$py_minor" BEST_MINOR="$py_minor"
fi fi
done done
echo "finished finding best python"
if [ -z "$BEST_PY" ]; then if [ -z "$BEST_PY" ]; then
echo "❌ ERROR: No Python version between 3.${MIN_PY_MINOR} and 3.${MAX_PY_MINOR} found on this system." echo "❌ ERROR: No Python version between 3.${MIN_PY_MINOR} and 3.${MAX_PY_MINOR} found on this system."
echo " Detected Python 3 installations:" echo " Detected Python 3 installations:"