allow configuration of a suffix for each config item. (#1290)

Co-authored-by: scbedd <45376673+scbedd@users.noreply.github.com>
This commit is contained in:
Azure SDK Bot 2021-01-08 12:29:22 -08:00 committed by GitHub
parent 6b6df8fbdc
commit 31f3a99ce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -39,6 +39,7 @@ $targets = ($Configs | ConvertFrom-Json).targets
# mode:
# monikerid:
# content_folder:
# suffix:
#}
$apiUrl = "https://api.github.com/repos/$repoId"

View File

@ -93,13 +93,17 @@ $targets = ($Configs | ConvertFrom-Json).targets
foreach ($config in $targets) {
if ($config.mode -eq "Preview") { $includePreview = $true } else { $includePreview = $false }
$pkgsFiltered = $pkgs | ? { $_.IsPrerelease -eq $includePreview}
$suffix = ""
if ($config.suffix) {
$suffix = $config.suffix
}
if ($pkgsFiltered) {
Write-Host "Given the visible artifacts, $($config.mode) Readme updates against $($config.path_to_config) will be processed for the following packages."
Write-Host ($pkgsFiltered | % { $_.PackageId + " " + $_.PackageVersion })
foreach ($packageInfo in $pkgsFiltered) {
$readmeName = "$($packageInfo.PackageId.Replace('azure-','').Replace('Azure.', '').Replace('@azure/', '').ToLower())-readme.md"
$readmeName = "$($packageInfo.PackageId.Replace('azure-','').Replace('Azure.', '').Replace('@azure/', '').ToLower())-readme${suffix}.md"
$readmeFolder = Join-Path $DocRepoLocation $config.content_folder
$readmeLocation = Join-Path $readmeFolder $readmeName