Merge pull request #7510 fix get-distro.sh for windows
chore: fix get-distro.sh for windows
This commit is contained in:
commit
5b36ec8cb2
2
Makefile
2
Makefile
|
@ -99,7 +99,7 @@ $(PROFILES:%=clean-%):
|
|||
.PHONY: clean-all
|
||||
clean-all:
|
||||
@rm -rf _build
|
||||
@rm rebar.lock
|
||||
@rm -f rebar.lock
|
||||
|
||||
.PHONY: deps-all
|
||||
deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
||||
|
|
|
@ -5,15 +5,24 @@
|
|||
|
||||
set -euo pipefail
|
||||
|
||||
if [ "$(uname -s)" = 'Darwin' ]; then
|
||||
echo 'macos'
|
||||
elif [ "$(uname -s)" = 'Linux' ]; then
|
||||
if grep -q -i 'centos' /etc/*-release; then
|
||||
UNAME="$(uname -s)"
|
||||
|
||||
case "$UNAME" in
|
||||
Darwin)
|
||||
SYSTEM='macos'
|
||||
;;
|
||||
Linux)
|
||||
if grep -q -i 'rhel' /etc/*-release; then
|
||||
DIST='centos'
|
||||
VERSION_ID="$(rpm --eval '%{centos_ver}')"
|
||||
VERSION_ID="$(rpm --eval '%{rhel}')"
|
||||
else
|
||||
DIST="$(sed -n '/^ID=/p' /etc/os-release | sed -r 's/ID=(.*)/\1/g' | sed 's/"//g')"
|
||||
VERSION_ID="$(sed -n '/^VERSION_ID=/p' /etc/os-release | sed -r 's/VERSION_ID=(.*)/\1/g' | sed 's/"//g')"
|
||||
fi
|
||||
echo "${DIST}${VERSION_ID}" | sed -r 's/([a-zA-Z]*)-.*/\1/g'
|
||||
fi
|
||||
SYSTEM="$(echo "${DIST}${VERSION_ID}" | sed -r 's/([a-zA-Z]*)-.*/\1/g')"
|
||||
;;
|
||||
CYGWIN*|MSYS*|MINGW*)
|
||||
SYSTEM="windows"
|
||||
;;
|
||||
esac
|
||||
echo "$SYSTEM"
|
||||
|
|
Loading…
Reference in New Issue