Skip to content

Commit 1c09990

Browse files
committed
Update build script to package with --pre-release
And not modify the readme with that note any more!
1 parent 4122dd7 commit 1c09990

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

vscode-powershell.build.ps1

+5-18
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ param(
1111

1212
# Grab package.json data which is used throughout the build.
1313
$script:PackageJson = Get-Content -Raw $PSScriptRoot/package.json | ConvertFrom-Json
14-
$script:IsPreviewExtension = $script:PackageJson.name -like "*preview*" -or $script:PackageJson.displayName -like "*preview*"
1514
Write-Host "`n### Extension: $($script:PackageJson.name)-$($script:PackageJson.version)`n" -ForegroundColor Green
1615

1716
function Get-EditorServicesPath {
@@ -128,26 +127,14 @@ task TestEditorServices -If (Get-EditorServicesPath) {
128127
#endregion
129128
#region Package tasks
130129

131-
task UpdateReadme -If { $script:IsPreviewExtension } {
132-
# Add the preview text
133-
$newReadmeTop = '# PowerShell Language Support for Visual Studio Code
134-
135-
> ## ATTENTION: This is the PREVIEW version of the PowerShell extension for VSCode which contains features that are being evaluated for stable. It works with PowerShell 5.1 and up.
136-
> ### If you are looking for the stable version, please [go here](https://marketplace.visualstudio.com/items?itemName=ms-vscode.PowerShell) or install the extension called "PowerShell" (not "PowerShell Preview")
137-
> ## NOTE: If you have both stable (aka "PowerShell") and preview (aka "PowerShell Preview") installed, you MUST [DISABLE](https://code.visualstudio.com/docs/editor/extension-gallery#_disable-an-extension) one of them for the best performance. Docs on how to disable an extension can be found [here](https://code.visualstudio.com/docs/editor/extension-gallery#_disable-an-extension)'
138-
$readmePath = (Join-Path $PSScriptRoot README.md)
139-
140-
$readmeContent = Get-Content -Path $readmePath
141-
if (!($readmeContent -match "This is the PREVIEW version of the PowerShell extension")) {
142-
$readmeContent[0] = $newReadmeTop
143-
$readmeContent | Set-Content $readmePath -Encoding utf8
144-
}
145-
}
146-
147130
task Package UpdateReadme, Build, {
148131
Write-Host "`n### Packaging $($script:PackageJson.name)-$($script:PackageJson.version).vsix`n" -ForegroundColor Green
149132
assert ((Get-Item ./modules).LinkType -ne "SymbolicLink") "Packaging requires a copy of PSES, not a symlink!"
150-
exec { & npm run package }
133+
if ($script:PackageJson.preview) {
134+
exec { & npm run package -- --pre-release }
135+
} else {
136+
exec { & npm run package }
137+
}
151138
}
152139

153140
#endregion

0 commit comments

Comments
 (0)