Skip to content

Commit

Permalink
First cut at migrating to legacy moniker
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljurek committed May 10, 2023
1 parent aaabe14 commit 1fe9972
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions eng/scripts/Language-Settings.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,11 @@ function Update-dotnet-DocsMsPackages($DocsRepoLocation, $DocsMetadata) {
(Join-Path $DocsRepoLocation 'bundlepackages/azure-dotnet.csv') `
'latest' `
$DocsMetadata

UpdateDocsMsPackages `
(Join-Path $DocsRepoLocation 'bundlepackages/azure-dotnet-legacy.csv') `
'legacy' `
$DocsMetadata
}

function UpdateDocsMsPackages($DocConfigFile, $Mode, $DocsMetadata) {
Expand Down Expand Up @@ -478,6 +483,25 @@ function UpdateDocsMsPackages($DocConfigFile, $Mode, $DocsMetadata) {
continue
}

if ($matchingPublishedPackage.Support -eq 'deprecated') {
if ($Mode -eq 'legacy') {

# Select the GA version, if none use the preview version
$updatedVersion = $matchingPublishedPackage.VersionGA.Trim()
if (!$updatedVersion) {
$updatedVersion = $matchingPublishedPackage.VersionPreview.Trim()
}
$package.Versions = @($updatedVersion)

Write-Host "Add deprecated package to legacy moniker: $($package.Name)"
$outputPackages += $package
} else {
Write-Host "Removing deprecated package: $($package.Name)"
}

continue
}

$updatedVersion = $matchingPublishedPackage.VersionGA.Trim()
if ($Mode -eq 'preview') {
$updatedVersion = $matchingPublishedPackage.VersionPreview.Trim()
Expand Down

0 comments on commit 1fe9972

Please sign in to comment.