Skip to content

Use PSRL release and filter out previous betas #745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 13 commits into from
Sep 13, 2018
18 changes: 0 additions & 18 deletions PowerShellEditorServices.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -310,24 +310,6 @@ task RestorePsesModules -After Build {
Save-Module @splatParameters
}

# TODO: Replace this with adding a new module to Save when a new PSReadLine release comes out to the Gallery
if (-not (Test-Path $PSScriptRoot/module/PSReadLine))
{
Write-Host "`tInstalling module: PSReadLine"

# Download AppVeyor zip
$jobId = (Invoke-RestMethod https://ci.appveyor.com/api/projects/lzybkr/PSReadLine).build.jobs[0].jobId
Invoke-RestMethod https://ci.appveyor.com/api/buildjobs/$jobId/artifacts/bin%2FRelease%2FPSReadLine.zip -OutFile $PSScriptRoot/module/PSRL.zip

# Position PSReadLine
Expand-Archive $PSScriptRoot/module/PSRL.zip $PSScriptRoot/module/PSRL
Move-Item $PSScriptRoot/module/PSRL/PSReadLine $PSScriptRoot/module

# Clean up
Remove-Item -Force -Recurse $PSScriptRoot/module/PSRL.zip
Remove-Item -Force -Recurse $PSScriptRoot/module/PSRL
}

Write-Host "`n"
}

Expand Down
7 changes: 6 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ environment:

install:
- ps: |
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | Out-Null
Get-Module PowerShellGet,PackageManagement | Remove-Module -Force -Verbose
powershell -Command { Install-Module -Name PowershellGet -MinimumVersion 1.6 -force -confirm:$false -verbose }
powershell -Command { Install-Module -Name PackageManagement -MinimumVersion 1.1.7.0 -Force -Confirm:$false -Verbose }
Import-Module -Name PowerShellGet -MinimumVersion 1.6 -Force
Import-Module -Name PackageManagement -MinimumVersion 1.1.7.0 -Force
Install-PackageProvider -Name NuGet -Force | Out-Null
Import-PackageProvider NuGet -Force | Out-Null
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null
Install-Module InvokeBuild -MaximumVersion 5.1.0 -Scope CurrentUser -Force | Out-Null
Expand Down
5 changes: 5 additions & 0 deletions modules.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@
"MinimumVersion":"1.0",
"MaximumVersion":"1.99",
"AllowPrerelease":false
},
"PSReadLine":{
"MinimumVersion":"2.0.0-beta3",
"MaximumVersion":"2.1",
"AllowPrerelease":true
}
}
9 changes: 8 additions & 1 deletion scripts/travis.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@

Get-Module PowerShellGet,PackageManagement | Remove-Module -Force -Verbose
powershell -Command { Install-Module -Name PowershellGet -MinimumVersion 1.6 -Scope CurrentUser -force -confirm:$false -verbose }
powershell -Command { Install-Module -Name PackageManagement -MinimumVersion 1.1.7.0 -Scope CurrentUser -Force -Confirm:$false -Verbose }
Import-Module -Name PowerShellGet -MinimumVersion 1.6 -Force
Import-Module -Name PackageManagement -MinimumVersion 1.1.7.0 -Force
Install-PackageProvider -Name NuGet -Force | Out-Null
Import-PackageProvider NuGet -Force | Out-Null
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted | Out-Null

# Install InvokeBuild
Install-Module InvokeBuild -MaximumVersion 5.1.0 -Scope CurrentUser -Force
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ internal class PSReadLinePromptContext : IPromptContext {
[System.Diagnostics.DebuggerStepThrough()]
param()
end {
$module = Get-Module -ListAvailable PSReadLine | Where-Object Version -ge '2.0.0' | Sort-Object -Descending Version | Select-Object -First 1
$module = Get-Module -ListAvailable PSReadLine |
Where-Object Version -ge '2.0.0' |
Where-Object { $_.PrivateData.PSData.Prerelease -notin 'beta1','beta2' } |
Sort-Object -Descending Version |
Select-Object -First 1
if (-not $module) {
return
}
Expand Down