Skip to content

Commit 4122dd7

Browse files
committed
Update release tools to combine preview and stable extensions
Still need to pass `--pre-release` to the `vsce` scripts.
1 parent dfd2bba commit 4122dd7

File tree

2 files changed

+4
-18
lines changed

2 files changed

+4
-18
lines changed

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
2-
"name": "powershell-preview",
3-
"displayName": "PowerShell Preview",
2+
"name": "powershell",
3+
"displayName": "PowerShell",
44
"version": "2023.3.0",
55
"preview": true,
66
"publisher": "ms-vscode",
7-
"description": "(Preview) Develop PowerShell modules, commands and scripts in Visual Studio Code!",
7+
"description": "Develop PowerShell modules, commands and scripts in Visual Studio Code!",
88
"engines": {
99
"vscode": "^1.67.0"
1010
},

tools/ReleaseTools.psm1

+1-15
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,7 @@ function Update-Changelog {
301301
- package.json:
302302
- `version` field with `"X.Y.Z"` and no prefix or suffix
303303
- `preview` field set to `true` or `false` if version is a preview
304-
- `name` field has `-preview` appended similarly
305-
- `displayName` field has ` Preview` appended similarly
306-
- `description` field has `(Preview) ` prepended similarly
307-
- `icon` field has `_Preview ` inserted similarly
304+
- `icon` field has `_Preview ` inserted if preview
308305
#>
309306
function Update-Version {
310307
[CmdletBinding(SupportsShouldProcess)]
@@ -318,34 +315,23 @@ function Update-Version {
318315

319316
Update-Branch -RepositoryName $RepositoryName
320317

321-
# TODO: Maybe cleanup the replacement logic.
322318
Use-Repository -RepositoryName $RepositoryName -Script {
323319
switch ($RepositoryName) {
324320
"vscode-powershell" {
325-
$d = "Develop PowerShell modules, commands and scripts in Visual Studio Code!"
326321
if ($Version.PreReleaseLabel) {
327-
$name = "powershell-preview"
328-
$displayName = "PowerShell Preview"
329322
$preview = "true"
330-
$description = "(Preview) $d"
331323
$icon = "media/PowerShell_Preview_Icon.png"
332324
} else {
333-
$name = "powershell"
334-
$displayName = "PowerShell"
335325
$preview = "false"
336-
$description = $d
337326
$icon = "media/PowerShell_Icon.png"
338327
}
339328

340329
$path = "package.json"
341330
$f = Get-Content -Path $path
342331
# NOTE: The prefix regex match two spaces exactly to avoid matching
343332
# nested objects in the file.
344-
$f = $f -replace '^(?<prefix> "name":\s+")(.+)(?<suffix>",)$', "`${prefix}${name}`${suffix}"
345-
$f = $f -replace '^(?<prefix> "displayName":\s+")(.+)(?<suffix>",)$', "`${prefix}${displayName}`${suffix}"
346333
$f = $f -replace '^(?<prefix> "version":\s+")(.+)(?<suffix>",)$', "`${prefix}${v}`${suffix}"
347334
$f = $f -replace '^(?<prefix> "preview":\s+)(.+)(?<suffix>,)$', "`${prefix}${preview}`${suffix}"
348-
$f = $f -replace '^(?<prefix> "description":\s+")(.+)(?<suffix>",)$', "`${prefix}${description}`${suffix}"
349335
$f = $f -replace '^(?<prefix> "icon":\s+")(.+)(?<suffix>",)$', "`${prefix}${icon}`${suffix}"
350336
$f | Set-Content -Path $path
351337
git add $path

0 commit comments

Comments
 (0)