Skip to content

Commit 3597bae

Browse files
committed
feat(brew): make brew tarball download work for aarch64
The prepackaged brew tarball download will now download the version for the correct architecture on x86_64 and aarch64, and will give an error on other architectures (since the uBlue repo doesn't package brew for other architectures).
1 parent 4f1ddef commit 3597bae

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

modules/brew/brew.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,16 @@ else
113113
# Download pre-packaged Brew from uBlue repo
114114
asset_urls=$(curl -fLsS --retry 5 'https://api.github.com/repos/ublue-os/packages/releases' \
115115
| jq -cr '.[0].assets | map({(.name): .browser_download_url}) | add')
116-
brew_tarball_url=$(jq -cr '."homebrew-x86_64.tar.zst"' <<< "${asset_urls}")
117-
brew_sha256_url=$(jq -cr '."homebrew-x86_64.sha256"' <<< "${asset_urls}")
116+
arch=$(uname -m)
117+
case "$arch" in
118+
x86_64|aarch64)
119+
brew_tarball_url=$(jq -cr --arg arch "$arch" '.["homebrew-" + $arch + ".tar.zst"]' <<< "${asset_urls}")
120+
brew_sha256_url=$(jq -cr --arg arch "$arch" '.["homebrew-" + $arch + ".sha256"]' <<< "${asset_urls}")
121+
;;
122+
*)
123+
echo "ERROR: Pre-packaged Brew tarball is not available for architecture ${arch}."
124+
exit 1
125+
esac
118126

119127
echo "Downloading Brew tarball..."
120128
curl -fLsS --retry 5 --create-dirs \

0 commit comments

Comments
 (0)