Skip to content

Commit 592e7d0

Browse files
authored
Check if 7zip executable exists (#124)
1 parent 344c408 commit 592e7d0

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

PhpManager/private/Expand-ArchiveWith7Zip.ps1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
}
5656
$sevenZipArguments += $ArchivePath
5757
$sevenZipPath = [System.IO.Path]::Combine($PSScriptRoot, 'bin', "7za-$sevenZipArchitecture.exe")
58+
If (-Not(Test-Path -LiteralPath $sevenZipPath -PathType Leaf)) {
59+
throw "7-Zip executable not found at $sevenZipPath"
60+
}
5861
$sevenZipResult = & $sevenZipPath $sevenZipArguments
5962
if ($LASTEXITCODE -ne 0) {
6063
if ($createdHere) {

0 commit comments

Comments
 (0)