From 4b0fe016f35be63cea57cf60387ee3962cfda222 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Fri, 6 May 2022 14:49:50 +0200 Subject: [PATCH] build(macos): do not depend on gsed --- scripts/get-distro.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/get-distro.sh b/scripts/get-distro.sh index 48d52122c..4bf81afb3 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 ':' -f2 | cut -d'.' -f1 | tr -d ' \t')" + SYSTEM="${DIST}${VERSION_ID}" ;; Linux) if grep -q -i 'rhel' /etc/*-release; then