diff --git a/scripts/get-distro.sh b/scripts/get-distro.sh index d70151209..512abdab6 100755 --- a/scripts/get-distro.sh +++ b/scripts/get-distro.sh @@ -10,8 +10,8 @@ UNAME="$(uname -s)" case "$UNAME" in Darwin) DIST='macos' - VERSION_ID=$(sw_vers | gsed -n '/^ProductVersion:/p' | gsed -r 's/ProductVersion:(.*)/\1/g' | gsed -r 's/([0-9]+).*/\1/g' | gsed 's/^[ \t]*//g') - SYSTEM="$(echo "${DIST}${VERSION_ID}" | gsed -r 's/([a-zA-Z]*)-.*/\1/g')" + VERSION_ID="$(sw_vers | grep 'ProductVersion' | cut -d':' -f 2 | cut -d'.' -f1 | tr -d ' \t')" + SYSTEM="${DIST}${VERSION_ID}" ;; Linux) if grep -q -i 'rhel' /etc/*-release; then