Skip to content

Commit

Permalink
fix download swoole-cli runtime bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jingjingxyk committed Dec 5, 2024
1 parent 7fef348 commit 9723f24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions setup-swoole-cli-runtime.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9723f24

Please sign in to comment.