Skip to content

Commit

Permalink
Refactor release_name function to be more resilient detecting archite…
Browse files Browse the repository at this point in the history
…cture on macOS [#350]
  • Loading branch information
zorfling authored and reillysiemens committed Nov 8, 2023
1 parent 6c80e9a commit f2142f8
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,15 @@ release_name() {
case "${os_name}" in
Darwin)
name="${name}-osx"
arch="$(echo $os_info | rev | cut -d ' ' -f1 | rev)"

case "${arch}" in
arm64)
name="${name}-arm64"
;;
x86_64)
name="${name}-x64"
;;
*)
error "Unsupported architecture '${arch}', unable to download a release"
exit 1
;;
esac
# check if os_info contains arm64 or x86_64
if echo $os_info | grep -q arm64; then
name="${name}-arm64"
elif echo $os_info | grep -q x86_64; then
name="${name}-x64"
else
error "Unsupported architecture '${arch}', unable to download a release"
exit 1
fi
;;
*)
error "Unsupported OS '${os_name}', unable to download a release"
Expand Down

0 comments on commit f2142f8

Please sign in to comment.