From d7ba296a206c869a75e45da979cda36d6cdc6685 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E8=B1=AA?= <504595380@qq.com> Date: Tue, 14 May 2024 07:58:13 +0800 Subject: [PATCH] fix(install.sh): support windows mingw platform (#11017) --- src/cli/install.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/cli/install.sh b/src/cli/install.sh index 1bb2eae9d1..a2530c324b 100644 --- a/src/cli/install.sh +++ b/src/cli/install.sh @@ -1,9 +1,13 @@ #!/usr/bin/env bash set -euo pipefail +platform=$(uname -ms) + if [[ ${OS:-} = Windows_NT ]]; then + if [[ $platform != MINGW64* ]]; then powershell -c "irm bun.sh/install.ps1|iex" exit $? + fi fi # Reset @@ -56,7 +60,7 @@ if [[ $# -gt 2 ]]; then error 'Too many arguments, only 2 are allowed. The first can be a specific tag of bun to install. (e.g. "bun-v0.1.4") The second can be a build variant of bun to install. (e.g. "debug-info")' fi -case $(uname -ms) in +case $platform in 'Darwin x86_64') target=darwin-x64 ;; @@ -66,6 +70,9 @@ case $(uname -ms) in 'Linux aarch64' | 'Linux arm64') target=linux-aarch64 ;; +'MINGW64'*) + target=windows-x64 + ;; 'Linux x86_64' | *) target=linux-x64 ;;