From ece11307973d4712ea96c3ec2777903da3354f63 Mon Sep 17 00:00:00 2001 From: knoflook Date: Wed, 13 Oct 2021 15:51:19 +0200 Subject: [PATCH] build: add automatic os and architecture detection to installer script --- scripts/installer/installer | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/installer/installer b/scripts/installer/installer index 25413b0a..243d9d89 100755 --- a/scripts/installer/installer +++ b/scripts/installer/installer @@ -35,9 +35,11 @@ function install_abra_release { fi # FIXME: support different architectures - release_url=$(curl -s $ABRA_RELEASE_URL | sed -rn 's/.*"assets":\[\{[^}]*"name":"abra.*linux_x86_64"[^}]*"browser_download_url":"([^"]*)".*\].*/\1/p' -) + PLATFORM=$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m) + sed_command='s/.*"assets":\[\{[^}]*"name":"abra.*_'"$PLATFORM"'"[^}]*"browser_download_url":"([^"]*)".*\].*/\1/p' + release_url=$(curl -s $ABRA_RELEASE_URL | sed -rn $sed_command -) - echo "downloading $ABRA_VERSION x86_64 binary release for abra..." + echo "downloading $ABRA_VERSION $PLATFORM binary release for abra..." curl --progress-bar "$release_url" --output "$HOME/.local/bin/abra" chmod +x "$HOME/.local/bin/abra"