From 01c0c3f7bd809d77dd8e5f01faab83a178ed0d9e Mon Sep 17 00:00:00 2001 From: sima-zhu Date: Tue, 22 Mar 2022 22:48:10 -0700 Subject: [PATCH 1/3] Remove extra files --- eng/common/scripts/Update-DocsMsToc.ps1 | 15 ++++++++++----- eng/common/scripts/common.ps1 | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/eng/common/scripts/Update-DocsMsToc.ps1 b/eng/common/scripts/Update-DocsMsToc.ps1 index 4e6db16f47..3b8772e5fe 100644 --- a/eng/common/scripts/Update-DocsMsToc.ps1 +++ b/eng/common/scripts/Update-DocsMsToc.ps1 @@ -102,11 +102,16 @@ $onboardedPackages = &$GetOnboardedDocsMsPackagesFn ` # because we need to generate ToCs for packages which are not necessarily "New" # in the metadata AND onboard legacy packages (which `Update-DocsMsPackages.ps1` # does not do) -$metadata = (Get-CSVMetadata).Where({ - $_.Package ` - -and $onboardedPackages.ContainsKey($_.Package) ` - -and $_.Hide -ne 'true' - }) +$fullMetadata = Get-CSVMetadata +$metadata = @() +foreach($metadataEntry in $fullMetadata) { + if ($metadataEntry.Package -and $metadataEntry.Hide -ne 'true') { + $pkgKey = GetPackageKey $metadataEntry + if($onboardedPackages.ContainsKey($pkgKey)) { + $metadata = @($metadataEntry) + } + } +} $fileMetadata = @() foreach ($metadataFile in Get-ChildItem "$DocRepoLocation/metadata/*/*.json" -Recurse) { diff --git a/eng/common/scripts/common.ps1 b/eng/common/scripts/common.ps1 index c01f9c9f53..d1f5d510d3 100644 --- a/eng/common/scripts/common.ps1 +++ b/eng/common/scripts/common.ps1 @@ -49,4 +49,4 @@ $ValidateDocsMsPackagesFn = "Validate-${Language}-DocMsPackages" $GetOnboardedDocsMsPackagesFn = "Get-${Language}-OnboardedDocsMsPackages" $GetDocsMsTocDataFn = "Get-${Language}-DocsMsTocData" $GetDocsMsTocChildrenForManagementPackagesFn = "Get-${Language}-DocsMsTocChildrenForManagementPackages" -$UpdateDocsMsTocFn = "Get-${Language}-UpdatedDocsMsToc" +$UpdateDocsMsTocFn = "Get-${Language}-UpdatedDocsMsToc" \ No newline at end of file From 54edee04cb50b3e5064e5bbc5847bebb4311d921 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Tue, 22 Mar 2022 22:50:40 -0700 Subject: [PATCH 2/3] Update common.ps1 --- eng/common/scripts/common.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/common.ps1 b/eng/common/scripts/common.ps1 index d1f5d510d3..c01f9c9f53 100644 --- a/eng/common/scripts/common.ps1 +++ b/eng/common/scripts/common.ps1 @@ -49,4 +49,4 @@ $ValidateDocsMsPackagesFn = "Validate-${Language}-DocMsPackages" $GetOnboardedDocsMsPackagesFn = "Get-${Language}-OnboardedDocsMsPackages" $GetDocsMsTocDataFn = "Get-${Language}-DocsMsTocData" $GetDocsMsTocChildrenForManagementPackagesFn = "Get-${Language}-DocsMsTocChildrenForManagementPackages" -$UpdateDocsMsTocFn = "Get-${Language}-UpdatedDocsMsToc" \ No newline at end of file +$UpdateDocsMsTocFn = "Get-${Language}-UpdatedDocsMsToc" From 6613d2ac2fe1eae2f15ed25f3d0f3a068e9ecc38 Mon Sep 17 00:00:00 2001 From: Sima Zhu <48036328+sima-zhu@users.noreply.github.com> Date: Wed, 23 Mar 2022 10:34:38 -0700 Subject: [PATCH 3/3] Update Update-DocsMsToc.ps1 --- eng/common/scripts/Update-DocsMsToc.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/common/scripts/Update-DocsMsToc.ps1 b/eng/common/scripts/Update-DocsMsToc.ps1 index 3b8772e5fe..56d9799f95 100644 --- a/eng/common/scripts/Update-DocsMsToc.ps1 +++ b/eng/common/scripts/Update-DocsMsToc.ps1 @@ -108,7 +108,7 @@ foreach($metadataEntry in $fullMetadata) { if ($metadataEntry.Package -and $metadataEntry.Hide -ne 'true') { $pkgKey = GetPackageKey $metadataEntry if($onboardedPackages.ContainsKey($pkgKey)) { - $metadata = @($metadataEntry) + $metadata += $metadataEntry } } }