From bd9103c1136ffde02030f29969c6da4760712eb5 Mon Sep 17 00:00:00 2001 From: Roland Tannous Date: Tue, 17 Mar 2026 04:43:07 +0000 Subject: [PATCH] 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. --- studio/setup.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/studio/setup.sh b/studio/setup.sh index 9754473798..dcb4372ced 100755 --- a/studio/setup.sh +++ b/studio/setup.sh @@ -172,7 +172,8 @@ for candidate in $(compgen -c python3 2>/dev/null | grep -E '^python3(\.[0-9]+)? continue fi # 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_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" fi done - +echo "finished finding best python" 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 " Detected Python 3 installations:"