Update script to be used with macOS apple silicon

This commit is contained in:
curquiza 2022-11-30 14:14:46 +01:00
parent 8d405fad12
commit eab1156f8c

View File

@ -1,5 +1,8 @@
#!/bin/sh #!/bin/sh
# This script works with a GitHub token to increase your request limit (for example, if using this script in a CI).
# To make it work, fill the GITHUB_PAT environment variable with your GitHub token.
# GLOBALS # GLOBALS
# Colors # Colors
@ -17,8 +20,8 @@ GITHUB_REL='https://github.com/meilisearch/meilisearch/releases/download/'
# FUNCTIONS # FUNCTIONS
# Create GITHUB_PAT environment variable once you acquired the token to start using it. # Gets the version of the latest stable version of Meilisearch by setting the $latest variable.
# Returns the tag of the latest stable release (in terms of semver and not of release date). # Returns 0 in case of success, 1 otherwise.
get_latest() { get_latest() {
# temp_file is needed because the grep would start before the download is over # temp_file is needed because the grep would start before the download is over
temp_file=$(mktemp -q /tmp/$PNAME.XXXXXXXXX) temp_file=$(mktemp -q /tmp/$PNAME.XXXXXXXXX)
@ -71,9 +74,9 @@ get_archi() {
archi='amd64' archi='amd64'
;; ;;
'arm64') 'arm64')
# MacOS M1 # macOS M1/M2
if [ $os = 'macos' ]; then if [ $os = 'macos' ]; then
archi='amd64' archi='apple-silicon'
else else
archi='aarch64' archi='aarch64'
fi fi