From 533569b1ac4ab1bf6502879b3f3567c1cf9a1e4b Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Tue, 8 Sep 2020 23:40:36 +0000 Subject: [PATCH 1/3] Sync eng/common directory with azure-sdk-tools repository for Tools PR 973 --- eng/common/scripts/update-docs-metadata.ps1 | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/eng/common/scripts/update-docs-metadata.ps1 b/eng/common/scripts/update-docs-metadata.ps1 index 7cf65fa7d2a4..34aa42801ec0 100644 --- a/eng/common/scripts/update-docs-metadata.ps1 +++ b/eng/common/scripts/update-docs-metadata.ps1 @@ -73,16 +73,13 @@ function GetAdjustedReadmeContent($pkgInfo, $lang){ $foundTitle = "" # only replace the version if the formatted header can be found - $headerContentMatches = (Select-String -InputObject $pkgInfo.ReadmeContent -Pattern 'Azure .+? (client|plugin|shared) library for (JavaScript|Java|Python|\.NET|C)') - if ($headerContentMatches) { - $foundTitle = $headerContentMatches.Matches[0] - $fileContent = $pkgInfo.ReadmeContent -replace $foundTitle, "$foundTitle - Version $($pkgInfo.PackageVersion) `n" - - # Replace github master link with release tag. - $ReplacementPattern = "`${1}$($pkgInfo.Tag)" - $fileContent = $fileContent -replace $releaseReplaceRegex, $ReplacementPattern - } - + $titleRegex = "(\# Azure .+? (?:client|plugin|shared) library for (?:JavaScript|Java|Python|\.NET|C))" + $fileContent = $pkgInfo.ReadmeContent -replace $titleRegex, "`${1} - Version $($pkgInfo.PackageVersion) `n" + + # Replace github master link with release tag. + $ReplacementPattern = "`${1}$($pkgInfo.Tag)" + $fileContent = $fileContent -replace $releaseReplaceRegex, $ReplacementPattern + $header = "---`ntitle: $foundTitle`nkeywords: Azure, $lang, SDK, API, $($pkgInfo.PackageId), $service`nauthor: maggiepint`nms.author: magpint`nms.date: $date`nms.topic: article`nms.prod: azure`nms.technology: azure`nms.devlang: $lang`nms.service: $service`n---`n" if ($fileContent) { From a7c8198818d6202b44d4d41bfa602daa4e66fba2 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Fri, 11 Sep 2020 10:43:47 -0700 Subject: [PATCH 2/3] Update update-docs-metadata.ps1 --- eng/common/scripts/update-docs-metadata.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/update-docs-metadata.ps1 b/eng/common/scripts/update-docs-metadata.ps1 index 34aa42801ec0..8d680720d11e 100644 --- a/eng/common/scripts/update-docs-metadata.ps1 +++ b/eng/common/scripts/update-docs-metadata.ps1 @@ -131,7 +131,7 @@ if ($pkgs) { } else { Write-Host "Unable to parse a header out of the readmecontent for PackageId $($packageInfo.PackageId)" } - } + } } else { Write-Host "No readmes discovered for doc release under folder $ArtifactLocation." From 52563036ada811ca86e772f88deeb87c0d5ca74d Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Fri, 11 Sep 2020 10:44:47 -0700 Subject: [PATCH 3/3] Update update-docs-metadata.ps1 --- eng/common/scripts/update-docs-metadata.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/update-docs-metadata.ps1 b/eng/common/scripts/update-docs-metadata.ps1 index 8d680720d11e..34aa42801ec0 100644 --- a/eng/common/scripts/update-docs-metadata.ps1 +++ b/eng/common/scripts/update-docs-metadata.ps1 @@ -131,7 +131,7 @@ if ($pkgs) { } else { Write-Host "Unable to parse a header out of the readmecontent for PackageId $($packageInfo.PackageId)" } - } + } } else { Write-Host "No readmes discovered for doc release under folder $ArtifactLocation."