Skip to content

Commit ee21d6e

Browse files
authored
Improve checking 7-zip exit code (#125)
1 parent 592e7d0 commit ee21d6e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

PhpManager/private/Expand-ArchiveWith7Zip.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@
5959
throw "7-Zip executable not found at $sevenZipPath"
6060
}
6161
$sevenZipResult = & $sevenZipPath $sevenZipArguments
62+
if ($null -eq $LASTEXITCODE) {
63+
if ($sevenZipResult) {
64+
throw "Extraction with 7-zip didn't set LASTEXITCODE; its output is $sevenZipResult"
65+
}
66+
throw "Extraction with 7-zip didn't set LASTEXITCODE"
67+
}
6268
if ($LASTEXITCODE -ne 0) {
6369
if ($createdHere) {
6470
try {

0 commit comments

Comments
 (0)