mirror of
https://github.com/php-win-ext/php-windows-builder.git
synced 2026-03-24 00:52:06 +01:00
Fix parsing extension name
This commit is contained in:
@@ -51,11 +51,15 @@ function Get-Extension {
|
||||
Copy-Item -Path "${subDirectory}\*" -Destination $currentDirectory -Recurse -Force
|
||||
Remove-Item -Path $subDirectory -Recurse -Force
|
||||
}
|
||||
$extensionLine = Get-Content -Path "config.w32" | Select-String -Pattern '\s+(ZEND_)?EXTENSION\(' | Select-Object -First 1
|
||||
$configW32Content = [string](Get-Content -Path "config.w32")
|
||||
$extensionLine = $configW32Content | Select-String -Pattern '\s+(ZEND_)?EXTENSION\(' | Select-Object -First 1
|
||||
if($null -eq $extensionLine) {
|
||||
throw "No extension found in config.w32"
|
||||
}
|
||||
$name = ($extensionLine -replace '.*EXTENSION\(([^,]+),.*', '$1') -replace '["'']', ''
|
||||
if ($configW32Content -match ($([regex]::Escape($name)) + '\s*=\s*["''](.+?)["'']')) {
|
||||
$name = $matches[1]
|
||||
}
|
||||
|
||||
# Apply patches only for php/php-windows-builder and shivammathur/php-windows-builder
|
||||
if($null -ne $env:GITHUB_REPOSITORY) {
|
||||
|
||||
Reference in New Issue
Block a user