Skip to content

Commit

Permalink
Sync eng/common directory with azure-sdk-tools repository for Tools P…
Browse files Browse the repository at this point in the history
…R 3169
  • Loading branch information
hallipr authored and azure-sdk committed Apr 20, 2022
1 parent 242e9a3 commit 80f2caf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions eng/common/scripts/Update-DocsMsMetadata.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ function GetPackageInfoJson ($packageInfoJsonLocation) {
# version is always 'dev' when interacting with NPM.
if ($GetDocsMsDevLanguageSpecificPackageInfoFn -and (Test-Path "Function:$GetDocsMsDevLanguageSpecificPackageInfoFn")) {
$packageInfo = &$GetDocsMsDevLanguageSpecificPackageInfoFn $packageInfo
} else {
}
else {
# Default: use the dev version from package info as the version for
# downstream processes
$packageInfo.Version = $packageInfo.DevVersion
Expand All @@ -168,15 +169,17 @@ function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation) {
$originalVersion = [AzureEngSemanticVersion]::ParseVersionString($packageInfo.Version)
$packageMetadataArray = (Get-CSVMetadata).Where({ $_.Package -eq $packageInfo.Name -and $_.Hide -ne 'true' -and $_.New -eq 'true' })
if ($packageInfo.Group) {
$packageMetadataArray = ($packageMetadataArray).Where({$_.GroupId -eq $packageInfo.Group})
$packageMetadataArray = ($packageMetadataArray).Where({ $_.GroupId -eq $packageInfo.Group })
}
if ($packageMetadataArray.Count -eq 0) {
LogWarning "Could not retrieve metadata for $($packageInfo.Name) from metadata CSV. Using best effort defaults."
$packageMetadata = $null
} elseif ($packageMetadataArray.Count -gt 1) {
}
elseif ($packageMetadataArray.Count -gt 1) {
LogWarning "Multiple metadata entries for $($packageInfo.Name) in metadata CSV. Using first entry."
$packageMetadata = $packageMetadataArray[0]
} else {
}
else {
$packageMetadata = $packageMetadataArray[0]
}

Expand Down Expand Up @@ -220,7 +223,7 @@ function UpdateDocsMsMetadataForPackage($packageInfoJsonLocation) {
if ($ValidateDocsMsPackagesFn -and (Test-Path "Function:$ValidateDocsMsPackagesFn")) {
Write-Host "Validating the packages..."

$packageInfos = @($PackageInfoJsonLocations | GetPackageInfoJson)
$packageInfos = @($PackageInfoJsonLocations | ForEach-Object { GetPackageInfoJson $_ })

&$ValidateDocsMsPackagesFn -PackageInfos $packageInfos -PackageSourceOverride $PackageSourceOverride -DocValidationImageId $DocValidationImageId -DocRepoLocation $DocRepoLocation
}
Expand Down

0 comments on commit 80f2caf

Please sign in to comment.