Skip to content

Commit

Permalink
Fix error handling in Install-IronPython.ps1
Browse files Browse the repository at this point in the history
  • Loading branch information
BCSharp committed Nov 21, 2023
1 parent d670a31 commit 9aa48ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Src/Scripts/Install-IronPython.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,13 @@ if (-not $ZipFile) {
# Script run from within a checked out code base
# Locate the zip archive in the standard location of the package target
$projectRoot = $PSScriptRoot | Split-Path | Split-Path
$ZipFile = @(Resolve-Path (Join-Path $projectRoot "Package/Release/Packages/IronPython-*/IronPython.3.*.zip"))
if ($ZipFile.Count -gt 1) {
Write-Error "Ambiguous implicit project zip file: $ZipFile"
} elseif ($ZipFile.Count -lt 1) {
$zipFiles = @(Resolve-Path (Join-Path $projectRoot "Package/Release/Packages/IronPython-*/IronPython.3.*.zip"))
if ($zipFiles.Count -gt 1) {
Write-Error (@("Ambiguous implicit project zip files:") + $zipFiles -join "`n")
} elseif ($zipFiles.Count -lt 1) {
Write-Error "Missing zip file. Have you run './make package'?"
}
$ZipFile = $zipFiles
} else {
Write-Error "Cannot locate implicit zip file. Provide path to the zip file using '-ZipFile <path>'."
}
Expand Down

0 comments on commit 9aa48ff

Please sign in to comment.