Skip to content

Commit

Permalink
Fix install script to run with powershell 5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
BCSharp committed Nov 15, 2023
1 parent d547e11 commit d670a31
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Src/Scripts/Install-IronPython.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ if (-not $unzipDir) {
}

# Copy files into place
Copy-Item -Path (Join-Path $unzipDir $Framework "*") -Destination $Path -Recurse
Copy-Item -Path (Join-Path $unzipDir (Join-Path $Framework "*")) -Destination $Path -Recurse
Copy-Item -Path (Join-Path $unzipDir "lib") -Destination $Path -Recurse

# Prepare startup scripts
Expand All @@ -108,6 +108,12 @@ 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")
Expand Down

0 comments on commit d670a31

Please sign in to comment.