Skip to content

Commit a21b019

Browse files
authored
fix download swoole-cli runtime bug (swoole#852)
1 parent 7fef348 commit a21b019

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

setup-swoole-cli-runtime.sh

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,17 @@ while [ $# -gt 0 ]; do
7070
;;
7171
--version)
7272
# 指定发布 TAG
73-
X_VERSION=$(echo "$2" | grep -E '^v\d\.\d{1,2}\.\d{1,2}\.\d{1,2}$')
74-
X_APP_VERSION=$(echo "$2" | grep -Eo '^v\d\.\d{1,2}\.\d{1,2}')
73+
if [ $OS = "macos" ]; then
74+
X_VERSION=$(echo "$2" | grep -E '^v\d\.\d{1,2}\.\d{1,2}\.\d{1,2}$')
75+
X_APP_VERSION=$(echo "$2" | grep -Eo '^v\d\.\d{1,2}\.\d{1,2}')
76+
elif [ $OS = "linux" ]; then
77+
X_VERSION=$(echo "$2" | grep -P '^v\d\.\d{1,2}\.\d{1,2}\.\d{1,2}$')
78+
X_APP_VERSION=$(echo "$2" | grep -Po '^v\d\.\d{1,2}\.\d{1,2}')
79+
else
80+
X_VERSION=''
81+
X_APP_VERSION=''
82+
fi
83+
7584
if [[ -n $X_VERSION ]] && [[ -n $X_APP_VERSION ]]; then
7685
{
7786
VERSION=$X_VERSION

0 commit comments

Comments
 (0)