From 462fec19687e76a8fde397ea5fbbb76162d0e73b Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 31 Jan 2024 07:22:13 -0800 Subject: [PATCH] Remove readarray from `install.sh` (#1198) ## Summary This isn't available on macOS (see, e.g., https://stackoverflow.com/questions/23842261/alternative-to-readarray-because-it-does-not-work-on-mac-os-x), but this version works both on macOS and Linux. Closes https://github.com/astral-sh/puffin/issues/1196. (Verified locally and on CI.) --- scripts/bootstrap/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/bootstrap/install.sh b/scripts/bootstrap/install.sh index 3c12c6b80..4751ec160 100755 --- a/scripts/bootstrap/install.sh +++ b/scripts/bootstrap/install.sh @@ -80,7 +80,10 @@ link_executables() { } # Read requested versions into an array -readarray -t versions < "$versions_file" +versions=() +while IFS= read -r version; do + versions+=("$version") +done < "$versions_file" # Install each version for version in "${versions[@]}"; do @@ -95,7 +98,6 @@ for version in "${versions[@]}"; do continue fi - url=$(jq --arg key "$key" '.[$key] | .url' -r < "$versions_metadata") if [ "$url" == 'null' ]; then