mirror of
https://github.com/shivammathur/setup-php.git
synced 2024-11-22 20:01:06 +07:00
Add fallback using expanded assets in Add-DebugSymbols on Windows
This commit is contained in:
parent
1fdc5e773b
commit
b951cf1d99
@ -281,13 +281,22 @@ Function Set-PhpCache {
|
|||||||
|
|
||||||
# Function to add debug symbols to PHP.
|
# Function to add debug symbols to PHP.
|
||||||
Function Add-DebugSymbols {
|
Function Add-DebugSymbols {
|
||||||
$release = Invoke-RestMethod https://api.github.com/repos/shivammathur/php-builder-windows/releases/tags/php$version
|
|
||||||
$dev = if ($version -match $nightly_versions) { '-dev' } else { '' }
|
$dev = if ($version -match $nightly_versions) { '-dev' } else { '' }
|
||||||
|
try {
|
||||||
|
$release = Invoke-RestMethod https://api.github.com/repos/shivammathur/php-builder-windows/releases/tags/php$version
|
||||||
$asset = $release.assets | ForEach-Object {
|
$asset = $release.assets | ForEach-Object {
|
||||||
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
|
} | Select-Object -Last 1
|
||||||
|
} catch {
|
||||||
|
$release = Get-File -Url $php_builder/releases/expanded_assets/php$version
|
||||||
|
$asset = $release.links.href | ForEach-Object {
|
||||||
|
if($_ -match "php-debug-pack-$version.[0-9]+$dev$env:PHPTS-Win32-.*-$arch.zip") {
|
||||||
|
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
|
||||||
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
|
||||||
|
Loading…
Reference in New Issue
Block a user