From 84651d5b073d1cbcdcb1753558b3f1bcd6ad66fa Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 4 Apr 2022 09:52:41 +0200 Subject: [PATCH 1/2] chore: no error when delete rebar.lock using make clean-all command --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5499d6dbe..0fb5c63e5 100644 --- a/Makefile +++ b/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-%) From d6d232a7dde48fa8c7504043819c485748eb34c3 Mon Sep 17 00:00:00 2001 From: "Zaiming (Stone) Shi" Date: Mon, 4 Apr 2022 10:02:51 +0200 Subject: [PATCH 2/2] chore: make get-distro.sh aware of windows --- scripts/get-distro.sh | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/scripts/get-distro.sh b/scripts/get-distro.sh index 2a2d39182..92e44ff2f 100755 --- a/scripts/get-distro.sh +++ b/scripts/get-distro.sh @@ -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 - DIST='centos' - VERSION_ID="$(rpm --eval '%{centos_ver}')" - 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 +UNAME="$(uname -s)" + +case "$UNAME" in + Darwin) + SYSTEM='macos' + ;; + Linux) + if grep -q -i 'rhel' /etc/*-release; then + DIST='centos' + 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 + SYSTEM="$(echo "${DIST}${VERSION_ID}" | sed -r 's/([a-zA-Z]*)-.*/\1/g')" + ;; + CYGWIN*|MSYS*|MINGW*) + SYSTEM="windows" + ;; +esac +echo "$SYSTEM"