summaryrefslogtreecommitdiffstats
path: root/install/install.sh
diff options
context:
space:
mode:
authorThomas O'Donnell <andytom@users.noreply.github.com>2020-10-25 10:16:47 +0100
committerGitHub <noreply@github.com>2020-10-25 10:16:47 +0100
commit9d5770544e8707352176b5546514dadc10863792 (patch)
tree4d4fdc86991017eacfd0615ae531a9cbaa29f580 /install/install.sh
parenteec961caaf41407545e81b5fb89745db0f0fa751 (diff)
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.
Diffstat (limited to 'install/install.sh')
-rwxr-xr-xinstall/install.sh19
1 files changed, 7 insertions, 12 deletions
diff --git a/install/install.sh b/install/install.sh
index 5b091cb2e..c14d3b9e0 100755
--- a/install/install.sh
+++ b/install/install.sh
@@ -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}"
}