Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install script fixes #146

Merged
merged 6 commits into from
Mar 21, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,10 @@ 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"
_platformOS="macos"
elif [[ "$OSTYPE" == "freebsd"* ]]; then
_platformOS="freebsd"
else
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 All @@ -76,7 +77,7 @@ function getPlatformOS() {
platformOSDist="${platformOSDist// /}"
platformOSVersion="${platformOSVersion// /}"

elif [ "$_platformOS" = "darwin" ]; then
elif [ "$_platformOS" = "macos" ]; then

platformOSDist=$(sw_vers | grep -m 1 'ProductName' | sed -E 's/.*:\s+(.*)/\1/')
platformOSVersion=$(sw_vers | grep -m 1 'ProductVersion' | sed -E 's/.*([0-9]+\.[0-9]+\.[0-9]+)/\1/g')
Expand Down