Fix Language-Settings.ps1 to use correct logic (#1427)

This commit is contained in:
Daniel Jurek 2021-01-21 21:59:12 -08:00 committed by GitHub
parent a0a3c6d5c5
commit cc1aeb4d3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)
}