Skip to content

Commit 12d9580

Browse files
committed
Sync eng/common directory with azure-sdk-tools repository for Tools PR 999
1 parent 87575b3 commit 12d9580

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

eng/common/scripts/update-docs-metadata.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,14 @@ function GetAdjustedReadmeContent($pkgInfo, $lang){
7070
}
7171

7272
$fileContent = $pkgInfo.ReadmeContent
73-
$foundTitle = ""
7473

7574
# only replace the version if the formatted header can be found
76-
$titleRegex = "(\# Azure .+? (?:client|plugin|shared) library for (?:JavaScript|Java|Python|\.NET|C))"
77-
$fileContent = $pkgInfo.ReadmeContent -replace $titleRegex, "`${1} - Version $($pkgInfo.PackageVersion) `n"
78-
75+
$titleRegex = "(\#\s+(?<filetitle>Azure .+? (?:client|plugin|shared) library for (?:JavaScript|Java|Python|\.NET|C)))"
76+
$foundTitle = ""
77+
if ($fileContent -match $titleRegex) {
78+
$fileContent = $fileContent -replace $titleRegex, "`${0} - Version $($pkgInfo.PackageVersion) `n"
79+
$foundTitle = $matches["filetitle"]
80+
}
7981
# Replace github master link with release tag.
8082
$ReplacementPattern = "`${1}$($pkgInfo.Tag)"
8183
$fileContent = $fileContent -replace $releaseReplaceRegex, $ReplacementPattern

0 commit comments

Comments
 (0)