Skip to content

Commit

Permalink
fix: Install script fixes (#146)
Browse files Browse the repository at this point in the history
- Fix install on OpenSuse, and macOS.

Co-authored-by: Gabriel Nützi <[email protected]>
  • Loading branch information
mruz and gabyx authored Mar 21, 2024
1 parent db6769c commit 4326c68
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ function getPlatformOS() {
local platformOSDist=""
local platformOSVersion=""

if [[ "$OSTYPE" == "linux-gnu"* ]]; then
_platformOS="linux"
elif [[ "$OSTYPE" == "linux-musl"* ]]; then
# Alpine linux
if [[ "$OSTYPE" == "linux"* ]]; then
_platformOS="linux"
elif [[ "$OSTYPE" == "darwin"* ]]; then
_platformOS="darwin"
Expand Down Expand Up @@ -67,6 +64,10 @@ function getPlatformOS() {
platformOSDist="redhat"
platformOSVersion=$(grep -m 1 "VERSION_ID=" "/etc/os-release" |
sed -E 's|.*="?([0-9]+\.[0-9]+).*|\1|')
elif grep -qE 'ID="?opensuse' "/etc/os-release"; then
platformOSDist="opensuse"
platformOSVersion=$(grep -m 1 "VERSION_ID=" "/etc/os-release" |
sed -E 's|.*="?([0-9]+\.[0-9]+).*|\1|')
else
die "Linux Distro '/etc/os-release' not supported currently:" \
"$(cat /etc/os-release 2>/dev/null)"
Expand Down Expand Up @@ -232,6 +233,11 @@ arch=""
getPlatformOS os
getPlatformArch arch

# The download used `macos` for `darwin` platform.
if [ "$os" = "darwin" ]; then
os="macos"
fi

# Download and install
response=$(curl --silent --location "https://api.github.com/repos/$org/$repo/releases/tags/$versionTag") || {
echo "Could not get releases from github.com."
Expand Down

0 comments on commit 4326c68

Please sign in to comment.