build: add automatic os and architecture detection to installer script
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
knoflook 2021-10-13 15:51:19 +02:00
parent c266316f7e
commit ece1130797
Signed by: knoflook
GPG Key ID: D6A1D0E8FC4FEF1C
1 changed files with 4 additions and 2 deletions

View File

@ -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"