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