Skip to content

Commit

Permalink
Merge pull request #5 from nabeken/update-script-arm64.sh
Browse files Browse the repository at this point in the history
support arm64 for the download
  • Loading branch information
nabeken authored Sep 15, 2022
2 parents ef24216 + 0ae6968 commit c719a65
Showing 1 changed file with 31 additions and 14 deletions.
45 changes: 31 additions & 14 deletions install-via-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,36 @@ usage() {
echo "usage: $0 -v VERSION" >&2
}

get_arch() {
case "$(uname -m)" in
aarch64|arm64)
echo "arm64"
;;
x86_64)
echo "amd64"
;;
*)
echo "Currently $(uname -m) isn't supported. PR is welcome." >&2
exit 1
;;
esac
}

get_os() {
case "$(uname -s)" in
Linux)
echo linux
;;
Darwin)
echo darwin
;;
*)
echo "Currently $(uname -s) isn't supported. PR is welcome." >&2
exit 1
;;
esac
}

while getopts hv: OPT; do
case $OPT in
v)
Expand All @@ -26,21 +56,8 @@ if [ -z "${VERSION}" ]; then
exit 1
fi

URL=
BASE_URL="https://github.com/nabeken/go-github-apps/releases/download/${VERSION}"

case "$(uname -s)" in
Linux)
URL="${BASE_URL}/go-github-apps_${VERSION#v}_linux_amd64.tar.gz"
;;
Darwin)
URL="${BASE_URL}/go-github-apps_${VERSION#v}_darwin_amd64.tar.gz"
;;
*)
echo "Currently $(uname -s) isn't supported. PR is welcome." >&2
exit 1
;;
esac
URL="${BASE_URL}/go-github-apps_${VERSION#v}_$(get_os)_$(get_arch).tar.gz"

shift $((OPTIND - 1))

Expand Down

0 comments on commit c719a65

Please sign in to comment.