@@ -301,10 +301,7 @@ function Update-Changelog {
301
301
- package.json:
302
302
- `version` field with `"X.Y.Z"` and no prefix or suffix
303
303
- `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
308
305
#>
309
306
function Update-Version {
310
307
[CmdletBinding (SupportsShouldProcess )]
@@ -318,34 +315,23 @@ function Update-Version {
318
315
319
316
Update-Branch - RepositoryName $RepositoryName
320
317
321
- # TODO: Maybe cleanup the replacement logic.
322
318
Use-Repository - RepositoryName $RepositoryName - Script {
323
319
switch ($RepositoryName ) {
324
320
" vscode-powershell" {
325
- $d = " Develop PowerShell modules, commands and scripts in Visual Studio Code!"
326
321
if ($Version.PreReleaseLabel ) {
327
- $name = " powershell-preview"
328
- $displayName = " PowerShell Preview"
329
322
$preview = " true"
330
- $description = " (Preview) $d "
331
323
$icon = " media/PowerShell_Preview_Icon.png"
332
324
} else {
333
- $name = " powershell"
334
- $displayName = " PowerShell"
335
325
$preview = " false"
336
- $description = $d
337
326
$icon = " media/PowerShell_Icon.png"
338
327
}
339
328
340
329
$path = " package.json"
341
330
$f = Get-Content - Path $path
342
331
# NOTE: The prefix regex match two spaces exactly to avoid matching
343
332
# 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}"
346
333
$f = $f -replace ' ^(?<prefix> "version":\s+")(.+)(?<suffix>",)$' , " `$ {prefix}${v} `$ {suffix}"
347
334
$f = $f -replace ' ^(?<prefix> "preview":\s+)(.+)(?<suffix>,)$' , " `$ {prefix}${preview} `$ {suffix}"
348
- $f = $f -replace ' ^(?<prefix> "description":\s+")(.+)(?<suffix>",)$' , " `$ {prefix}${description} `$ {suffix}"
349
335
$f = $f -replace ' ^(?<prefix> "icon":\s+")(.+)(?<suffix>",)$' , " `$ {prefix}${icon} `$ {suffix}"
350
336
$f | Set-Content - Path $path
351
337
git add $path
0 commit comments