diff --git a/src/scripts/extensions/zephir_parser.ps1 b/src/scripts/extensions/zephir_parser.ps1 index b7dbe734..53ac22da 100644 --- a/src/scripts/extensions/zephir_parser.ps1 +++ b/src/scripts/extensions/zephir_parser.ps1 @@ -8,10 +8,11 @@ Function Get-ZephirParserReleaseAssetUrl() { ) $repo = 'zephir-lang/php-zephir-parser' $zp_releases = "$github/$repo/releases" + $nts = if (!$installed.ThreadSafe) { "nts" } else { "ts" } try { - $match = (Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/tags/$extension_version").assets | Select-String -Pattern "browser_download_url=.*(zephir_parser-php-${version}.*windows.*.zip)" + $match = (Invoke-RestMethod -Uri "https://api.github.com/repos/$repo/tags/$extension_version").assets | Select-String -Pattern "browser_download_url=.*(zephir_parser-php-${version}-$nts-windows.*.zip)" } catch { - $match = (Get-File -Url "$zp_releases/expanded_assets/$extension_version").Links.href | Select-String -Pattern "(zephir_parser-php-${version}.*windows.*.zip)" + $match = (Get-File -Url "$zp_releases/expanded_assets/$extension_version").Links.href | Select-String -Pattern "(zephir_parser-php-${version}-$nts-windows.*.zip)" } if($NULL -ne $match) { return "$zp_releases/download/$extension_version/$($match.Matches[0].Groups[1].Value)" diff --git a/src/scripts/extensions/zephir_parser.sh b/src/scripts/extensions/zephir_parser.sh index 9ad6130e..f1c9b5d3 100644 --- a/src/scripts/extensions/zephir_parser.sh +++ b/src/scripts/extensions/zephir_parser.sh @@ -12,10 +12,11 @@ get_zephir_parser_version() { # Add zephir_parser helper add_zephir_parser_helper() { local ext=$1 + nts="${ts:?}" && nts="${nts/z/}" ext_version=$(get_zephir_parser_version "$ext") [ "$(uname -s)" = "Linux" ] && os_suffix=ubuntu || os_suffix=macos - build_name=$(get -s -n "" https://api.github.com/repos/"$repo"/releases/tags/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}.*$os_suffix-.*.zip" | head -n 1) - [ -z "$build_name" ] && build_name=$(get -s -n "" "$zp_releases"/expanded_assets/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}.*$os_suffix-.*.zip" | head -n 1) + build_name=$(get -s -n "" https://api.github.com/repos/"$repo"/releases/tags/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1) + [ -z "$build_name" ] && build_name=$(get -s -n "" "$zp_releases"/expanded_assets/"$ext_version" | grep -Eo "zephir_parser-php-${version:?}-$nts-$os_suffix-.*.zip" | head -n 1) get -q -e "/tmp/zp.zip" "$zp_releases"/download/"$ext_version"/"$build_name" sudo unzip -o "/tmp/zp.zip" -d "${ext_dir:?}" enable_extension zephir_parser extension