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.)
This commit is contained in:
Charlie Marsh 2024-01-31 07:22:13 -08:00 committed by GitHub
parent 8f9258fae3
commit 462fec1968
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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