fix(install): Better platform detection (#1827)

Have refactored the platform detection in the install script to try to
better detect Windows when running the Windows install script.
This commit is contained in:
Thomas O'Donnell 2020-10-25 10:16:47 +01:00 committed by GitHub
parent eec961caaf
commit 9d5770544e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 12 deletions

View File

@ -170,19 +170,14 @@ detect_platform() {
local platform
platform="$(uname -s | tr '[:upper:]' '[:lower:]')"
# mingw is Git-Bash
if echo "${platform}" | grep -i mingw >/dev/null; then
platform=pc-windows-msvc
fi
if [ "${platform}" = "linux" ]; then
case "${platform}" in
msys_nt*) platform="pc-windows-msvc" ;;
# mingw is Git-Bash
mingw*) platform="pc-windows-msvc" ;;
# use the statically compiled musl bins on linux to avoid linking issues.
platform=unknown-linux-musl
fi
if [ "${platform}" = "darwin" ]; then
platform=apple-darwin
fi
linux) platform="unknown-linux-musl" ;;
darwin) platform="apple-darwin" ;;
esac
echo "${platform}"
}