Fix selecting php-builder builds on Windows

This commit is contained in:
Shivam Mathur 2023-04-02 23:54:13 +05:30
parent 3e2462a699
commit 1f8252a3ed
No known key found for this signature in database
GPG Key ID: 3E13E4C8591ACC2A

View File

@ -258,7 +258,7 @@ Function Set-PhpCache {
if($_.name -match "php-$version.[0-9]+$env:PHPTS-Win32-.*-$arch.zip") { if($_.name -match "php-$version.[0-9]+$env:PHPTS-Win32-.*-$arch.zip") {
return $_.name return $_.name
} }
} } | Select-Object -Last 1
if($null -eq $asset) { if($null -eq $asset) {
throw "Asset not found" throw "Asset not found"
} }
@ -268,7 +268,7 @@ Function Set-PhpCache {
if($_ -match "php-$version.[0-9]+$env:PHPTS-Win32-.*-$arch.zip") { if($_ -match "php-$version.[0-9]+$env:PHPTS-Win32-.*-$arch.zip") {
return $_.split('/')[-1] return $_.split('/')[-1]
} }
} } | Select-Object -Last 1
} }
Get-File -Url $php_builder/releases/download/php$version/$asset -OutFile $php_dir\$asset Get-File -Url $php_builder/releases/download/php$version/$asset -OutFile $php_dir\$asset
Set-PhpDownloadCache -Path $php_dir CurrentUser Set-PhpDownloadCache -Path $php_dir CurrentUser
@ -283,7 +283,7 @@ Function Add-DebugSymbols {
if($_.name -match "php-debug-pack-$version.[0-9]+$dev$env:PHPTS-Win32-.*-$arch.zip") { if($_.name -match "php-debug-pack-$version.[0-9]+$dev$env:PHPTS-Win32-.*-$arch.zip") {
return $_.name return $_.name
} }
} } | Select-Object -Last 1
Get-File -Url $php_builder/releases/download/php$version/$asset -OutFile $php_dir\$asset Get-File -Url $php_builder/releases/download/php$version/$asset -OutFile $php_dir\$asset
Expand-Archive -Path $php_dir\$asset -DestinationPath $php_dir -Force Expand-Archive -Path $php_dir\$asset -DestinationPath $php_dir -Force
Get-ChildItem -Path $php_dir -Filter php_*.pdb | Move-Item -Destination $ext_dir Get-ChildItem -Path $php_dir -Filter php_*.pdb | Move-Item -Destination $ext_dir