From a21b019b9a848cde5c14b886dd60dfb62414bbd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=BD=E5=90=A7=EF=BC=8C=E4=BD=A0=E6=83=B3=E8=AF=B4?= =?UTF-8?q?=E5=95=A5?= Date: Fri, 6 Dec 2024 13:23:34 +0800 Subject: [PATCH] fix download swoole-cli runtime bug (#852) --- ext/swoole | 2 +- setup-swoole-cli-runtime.sh | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ext/swoole b/ext/swoole index c086ddffe1..535961680b 160000 --- a/ext/swoole +++ b/ext/swoole @@ -1 +1 @@ -Subproject commit c086ddffe19626e4ec953a19f556212d0a9110e2 +Subproject commit 535961680b82965bbdca0aaf0e066464467523a7 diff --git a/setup-swoole-cli-runtime.sh b/setup-swoole-cli-runtime.sh index 72868f7c68..8c3e378e27 100644 --- a/setup-swoole-cli-runtime.sh +++ b/setup-swoole-cli-runtime.sh @@ -70,8 +70,17 @@ while [ $# -gt 0 ]; do ;; --version) # 指定发布 TAG - X_VERSION=$(echo "$2" | grep -E '^v\d\.\d{1,2}\.\d{1,2}\.\d{1,2}$') - X_APP_VERSION=$(echo "$2" | grep -Eo '^v\d\.\d{1,2}\.\d{1,2}') + if [ $OS = "macos" ]; then + X_VERSION=$(echo "$2" | grep -E '^v\d\.\d{1,2}\.\d{1,2}\.\d{1,2}$') + X_APP_VERSION=$(echo "$2" | grep -Eo '^v\d\.\d{1,2}\.\d{1,2}') + elif [ $OS = "linux" ]; then + X_VERSION=$(echo "$2" | grep -P '^v\d\.\d{1,2}\.\d{1,2}\.\d{1,2}$') + X_APP_VERSION=$(echo "$2" | grep -Po '^v\d\.\d{1,2}\.\d{1,2}') + else + X_VERSION='' + X_APP_VERSION='' + fi + if [[ -n $X_VERSION ]] && [[ -n $X_APP_VERSION ]]; then { VERSION=$X_VERSION