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
|
.PHONY: clean-all
|
||||||
clean-all:
|
clean-all:
|
||||||
@rm -rf _build
|
@rm -rf _build
|
||||||
@rm rebar.lock
|
@rm -f rebar.lock
|
||||||
|
|
||||||
.PHONY: deps-all
|
.PHONY: deps-all
|
||||||
deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
deps-all: $(REBAR) $(PROFILES:%=deps-%)
|
||||||
|
|
|
@ -5,15 +5,24 @@
|
||||||
|
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
if [ "$(uname -s)" = 'Darwin' ]; then
|
UNAME="$(uname -s)"
|
||||||
echo 'macos'
|
|
||||||
elif [ "$(uname -s)" = 'Linux' ]; then
|
case "$UNAME" in
|
||||||
if grep -q -i 'centos' /etc/*-release; then
|
Darwin)
|
||||||
DIST='centos'
|
SYSTEM='macos'
|
||||||
VERSION_ID="$(rpm --eval '%{centos_ver}')"
|
;;
|
||||||
else
|
Linux)
|
||||||
DIST="$(sed -n '/^ID=/p' /etc/os-release | sed -r 's/ID=(.*)/\1/g' | sed 's/"//g')"
|
if grep -q -i 'rhel' /etc/*-release; then
|
||||||
VERSION_ID="$(sed -n '/^VERSION_ID=/p' /etc/os-release | sed -r 's/VERSION_ID=(.*)/\1/g' | sed 's/"//g')"
|
DIST='centos'
|
||||||
fi
|
VERSION_ID="$(rpm --eval '%{rhel}')"
|
||||||
echo "${DIST}${VERSION_ID}" | sed -r 's/([a-zA-Z]*)-.*/\1/g'
|
else
|
||||||
fi
|
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
|
||||||
|
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