Skip to content

Commit e5ef329

Browse files
committed
Fix PHP dependency archive extraction
1 parent 6372982 commit e5ef329

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

extension/BuildPhpExtension/private/Add-PhpDependencies.ps1

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ Function Add-PhpDependencies {
3535
throw "Failed to find $library"
3636
}
3737
$file = $matchesFound.Matches[0].Value.Trim()
38-
Get-File -Url "$phpBaseUrl/$($Config.vs_version)/$($Config.arch)/$file" -OutFile $library
39-
Expand-Archive $library "../deps" -Force
38+
$archive = Join-Path ([System.IO.Path]::GetTempPath()) ([System.Guid]::NewGuid().ToString() + '.zip')
39+
try {
40+
Get-File -Url "$phpBaseUrl/$($Config.vs_version)/$($Config.arch)/$file" -OutFile $archive
41+
Expand-Archive -LiteralPath $archive -DestinationPath "../deps" -Force
42+
} finally {
43+
Remove-Item -LiteralPath $archive -Force -ErrorAction SilentlyContinue
44+
}
4045
Add-BuildLog tick "$library" "Added $($file -replace '\.zip$')"
4146
} catch {
4247
Add-BuildLog cross "$library" "Failed to download $library"

0 commit comments

Comments
 (0)