From 378dc4e448c3cd2a72693ffca52fa0778ed728ff Mon Sep 17 00:00:00 2001 From: Pavel Koneski Date: Tue, 21 Nov 2023 12:49:47 -0800 Subject: [PATCH] Fix error handling in Install-IronPython.ps1 --- Src/Scripts/Install-IronPython.ps1 | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/Src/Scripts/Install-IronPython.ps1 b/Src/Scripts/Install-IronPython.ps1 index 8dacf6709..2604be916 100755 --- a/Src/Scripts/Install-IronPython.ps1 +++ b/Src/Scripts/Install-IronPython.ps1 @@ -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 '." } @@ -98,7 +99,7 @@ if (-not $unzipDir) { } # Copy files into place -Copy-Item -Path (Join-Path $unzipDir (Join-Path $Framework "*")) -Destination $Path -Recurse +Copy-Item -Path (Join-Path $unzipDir $Framework "*") -Destination $Path -Recurse Copy-Item -Path (Join-Path $unzipDir "lib") -Destination $Path -Recurse # Prepare startup scripts @@ -108,12 +109,6 @@ if ($Framework -notlike "net4*") { #!/usr/bin/env pwsh dotnet (Join-Path $PSScriptRoot ipy.dll) @args '@ - if ($PSVersionTable.PSEdition -eq "Desktop" -or $IsWindows) { - $ipyPath = Join-Path $Path "ipy.bat" - Set-Content -Path $ipyPath -Value @' -@dotnet "%~dp0ipy.dll" %* -'@ - } if ($IsMacOS -or $IsLinux) { chmod +x $ipyPath chmod +x (Join-Path $Path "ipy.sh")