@@ -4,10 +4,10 @@ Updates package README.md for publishing to docs.microsoft.com
44
55. DESCRIPTION
66Given a PackageInfo .json file, format the package README.md file with metadata
7- and other information needed to release reference docs:
7+ and other information needed to release reference docs:
88
99* Adjust README.md content to include metadata
10- * Insert the package verison number in the README.md title
10+ * Insert the package verison number in the README.md title
1111* Copy file to the appropriate location in the documentation repository
1212* Copy PackageInfo .json file to the metadata location in the reference docs
1313 repository. This enables the Docs CI build to onboard packages which have not
@@ -18,7 +18,7 @@ List of locations of the artifact information .json file. This is usually stored
1818in build artifacts under packages/PackageInfo/<package-name>.json. Can also be
1919a single item.
2020
21- . PARAMETER DocRepoLocation
21+ . PARAMETER DocRepoLocation
2222Location of the root of the docs.microsoft.com reference doc location. Further
2323path information is provided by $GetDocsMsMetadataForPackageFn
2424
4747 [array ]$PackageInfoJsonLocations ,
4848
4949 [Parameter (Mandatory = $true )]
50- [string ]$DocRepoLocation ,
50+ [string ]$DocRepoLocation ,
5151
5252 [Parameter (Mandatory = $true )]
5353 [string ]$Language ,
@@ -104,12 +104,12 @@ function GetAdjustedReadmeContent($ReadmeContent, $PackageInfo, $PackageMetadata
104104 $replacementPattern = " `$ {1}$tag "
105105 $ReadmeContent = $ReadmeContent -replace $releaseReplaceRegex , $replacementPattern
106106 }
107-
107+
108108 # Get the first code owners of the package.
109109 Write-Host " Retrieve the code owner from $ ( $PackageInfo.DirectoryPath ) ."
110- $author = GetPrimaryCodeOwner - TargetDirectory $PackageInfo.DirectoryPath
110+ $author = GetPrimaryCodeOwner - TargetDirectory $PackageInfo.DirectoryPath
111111 if (! $author ) {
112- $author = " ramya-rao-a"
112+ $author = " ramya-rao-a"
113113 $msauthor = " ramyar"
114114 }
115115 else {
@@ -148,10 +148,10 @@ function GetPackageInfoJson ($packageInfoJsonLocation) {
148148 $packageInfoJson = Get-Content $packageInfoJsonLocation - Raw
149149 $packageInfo = ConvertFrom-Json $packageInfoJson
150150 if ($packageInfo.DevVersion ) {
151- # If the package is of a dev version there may be language-specific needs to
152- # specify the appropriate version. For example, in the case of JS, the dev
151+ # If the package is of a dev version there may be language-specific needs to
152+ # specify the appropriate version. For example, in the case of JS, the dev
153153 # version is always 'dev' when interacting with NPM.
154- if ($GetDocsMsDevLanguageSpecificPackageInfoFn -and (Test-Path " Function:$GetDocsMsDevLanguageSpecificPackageInfoFn " )) {
154+ if ($GetDocsMsDevLanguageSpecificPackageInfoFn -and (Test-Path " Function:$GetDocsMsDevLanguageSpecificPackageInfoFn " )) {
155155 $packageInfo = & $GetDocsMsDevLanguageSpecificPackageInfoFn $packageInfo
156156 } else {
157157 # Default: use the dev version from package info as the version for
@@ -162,16 +162,16 @@ function GetPackageInfoJson ($packageInfoJsonLocation) {
162162 return $packageInfo
163163}
164164
165- function UpdateDocsMsMetadataForPackage ($packageInfoJsonLocation , $packageInfo ) {
165+ function UpdateDocsMsMetadataForPackage ($packageInfoJsonLocation , $packageInfo ) {
166166 $originalVersion = [AzureEngSemanticVersion ]::ParseVersionString($packageInfo.Version )
167167 $packageMetadataArray = (Get-CSVMetadata ).Where ({ $_.Package -eq $packageInfo.Name -and $_.Hide -ne ' true' -and $_.New -eq ' true' })
168168 if ($packageInfo.Group ) {
169169 $packageMetadataArray = ($packageMetadataArray ).Where ({$_.GroupId -eq $packageInfo.Group })
170170 }
171- if ($packageMetadataArray.Count -eq 0 ) {
171+ if ($packageMetadataArray.Count -eq 0 ) {
172172 LogWarning " Could not retrieve metadata for $ ( $packageInfo.Name ) from metadata CSV. Using best effort defaults."
173173 $packageMetadata = $null
174- } elseif ($packageMetadataArray.Count -gt 1 ) {
174+ } elseif ($packageMetadataArray.Count -gt 1 ) {
175175 LogWarning " Multiple metadata entries for $ ( $packageInfo.Name ) in metadata CSV. Using first entry."
176176 $packageMetadata = $packageMetadataArray [0 ]
177177 } else {
@@ -199,10 +199,10 @@ function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation, $packageInfo)
199199 Write-Warning " $ ( $packageInfo.Name ) does not have Readme file. Skipping update readme."
200200 return
201201 }
202-
202+
203203 $readmeContent = Get-Content $packageInfo.ReadMePath - Raw
204- $outputReadmeContent = " "
205- if ($readmeContent ) {
204+ $outputReadmeContent = " "
205+ if ($readmeContent ) {
206206 $outputReadmeContent = GetAdjustedReadmeContent $readmeContent $packageInfo $packageMetadata
207207 }
208208
0 commit comments