From cc1aeb4d3ffe9c5182cee945a76e2b219d820f95 Mon Sep 17 00:00:00 2001 From: Daniel Jurek Date: Thu, 21 Jan 2021 21:59:12 -0800 Subject: [PATCH] Fix Language-Settings.ps1 to use correct logic (#1427) --- eng/scripts/Language-Settings.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/eng/scripts/Language-Settings.ps1 b/eng/scripts/Language-Settings.ps1 index aeeb9f98d..dd0b54c33 100644 --- a/eng/scripts/Language-Settings.ps1 +++ b/eng/scripts/Language-Settings.ps1 @@ -9,6 +9,13 @@ $BlobStorageUrl = "https://azuresdkdocs.blob.core.windows.net/%24web?restype=con function Get-cpp-PackageInfoFromRepo($pkgPath, $serviceDirectory, $pkgName) { + # Test if the package path ends with the package name (e.g. sdk/storage/azure-storage-common) + # This function runs in a loop where $pkgPath might be the path to the package and must return + # $null in cases where $pkgPath is not the path to the package specified by $pkgName + if ($pkgName -ne (Split-Path -Leaf $pkgPath)) { + return $null + } + $packageVersion = & $PSScriptRoot/Get-PkgVersion.ps1 -ServiceDirectory $serviceDirectory -PackageName $pkgName return [PackageProps]::new($pkgName, $packageVersion, $pkgPath, $serviceDirectory) }