Skip to content

Commit

Permalink
Merge pull request #27 from camerondurham/unix-release-matrix
Browse files Browse the repository at this point in the history
Detect and download arm64 architecture
  • Loading branch information
camerondurham authored Nov 28, 2021
2 parents 47d3c8d + 917d476 commit 39f026e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions scripts/install-ch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,20 @@ function add_to_path() {
precheck

version=$(get_latest_release $repository)
architecture=$(uname -m)
operating_system=$(uname)
zip_filename=
if [ "$(uname)" = "Linux" ]; then
zip_filename="ch-linux-amd64.zip"
if [ "$operating_system" = "Linux" ] && { [ "$architecture" = "x86_64" ] || [ "$architecture" = "x86-64" ]; } then
zip_filename="ch-linux-amd64.zip"
elif [ "$operating_system" = "Linux" ] && [ "$architecture" = "aarch64" ]; then
# aarch64 is supposedly the same as arm64 and containerd treats them the
# same so we should be good
# https://stackoverflow.com/a/47274698/4676641
zip_filename="ch-linux-arm64.zip"
elif [ "$operating_system" = "Darwin" ] && [ "$architecture" = "arm64" ]; then
zip_filename="ch-darwin-arm64.zip"
else
zip_filename="ch-darwin-amd64.zip"
zip_filename="ch-darwin-amd64.zip"
fi

release_url=$(get_release_url "$repository" "$version" "$zip_filename")
Expand All @@ -97,4 +106,5 @@ if ! echo "$PATH" | grep ${zip_filename%.*} > /dev/null ; then
add_to_path "$HOME/${zip_filename%.*}"
fi

echo "Done! Try using ch with: ch --help"
echo "Done! Try using ch with: ch --help"

0 comments on commit 39f026e

Please sign in to comment.