build(macos): do not depend on gsed

This commit is contained in:
Zaiming (Stone) Shi 2022-05-06 14:57:38 +02:00
parent 495ef7f301
commit eb03e6ca9b
1 changed files with 2 additions and 2 deletions

View File

@ -10,8 +10,8 @@ UNAME="$(uname -s)"
case "$UNAME" in case "$UNAME" in
Darwin) Darwin)
DIST='macos' 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') VERSION_ID="$(sw_vers | grep 'ProductVersion' | cut -d':' -f 2 | cut -d'.' -f1 | tr -d ' \t')"
SYSTEM="$(echo "${DIST}${VERSION_ID}" | gsed -r 's/([a-zA-Z]*)-.*/\1/g')" SYSTEM="${DIST}${VERSION_ID}"
;; ;;
Linux) Linux)
if grep -q -i 'rhel' /etc/*-release; then if grep -q -i 'rhel' /etc/*-release; then