Skip to content

Commit

Permalink
Fix fetching extension version from PECL on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Nov 25, 2020
1 parent 4ec398d commit 19b0959
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scripts/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ get_pecl_version() {
stability="$(echo "$2" | grep -m 1 -Eio "(alpha|beta|rc|snapshot|preview)")"
pecl_rest='https://pecl.php.net/rest/r/'
response=$(get -s -n "" "$pecl_rest$extension"/allreleases.xml)
pecl_version=$(echo "$response" | grep -m 1 -Pio "(\d*\.\d*\.\d*$stability\d*)")
pecl_version=$(echo "$response" | grep -m 1 -Eio "([0-9]+\.[0-9]+\.[0-9]+${stability}[0-9]+)")
if [ ! "$pecl_version" ]; then
pecl_version=$(echo "$response" | grep -m 1 -Po "(\d*\.\d*\.\d*)")
pecl_version=$(echo "$response" | grep -m 1 -Eo "([0-9]+\.[0-9]+\.[0-9]+)")
fi
echo "$pecl_version"
}
Expand Down

0 comments on commit 19b0959

Please sign in to comment.