Skip to content

Commit 16574a3

Browse files
Update LanguageSetting.ps1 (Azure#12549)
1 parent 5013e83 commit 16574a3

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

eng/scripts/Language-Settings.ps1

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,22 @@ function IsNPMPackageVersionPublished ($pkgId, $pkgVersion)
3838
return $npmVersionList.Contains($pkgVersion)
3939
}
4040

41+
# make certain to always take the package json closest to the top
42+
function ResolvePkgJson($workFolder)
43+
{
44+
$pathsWithComplexity = @()
45+
foreach ($file in (Get-ChildItem -Path $workFolder -Recurse -Include "package.json"))
46+
{
47+
$complexity = ($file.FullName -Split { $_ -eq "/" -or $_ -eq "\" }).Length
48+
$pathsWithComplexity += New-Object PSObject -Property @{
49+
Path = $file
50+
Complexity = $complexity
51+
}
52+
}
53+
54+
return ($pathsWithComplexity | Sort-Object -Property Complexity)[0].Path
55+
}
56+
4157
# Parse out package publishing information given a .tgz npm artifact
4258
function Get-javascript-PackageInfoFromPackageFile ($pkg, $workingDirectory)
4359
{
@@ -98,7 +114,7 @@ function Publish-javascript-GithubIODocs ($DocLocation, $PublicArtifactLocation)
98114
{
99115
$DocVersion = $dirList[0].Name
100116
Write-Host "Uploading Doc for $($PkgName) Version:- $($DocVersion)..."
101-
$releaseTag = RetrieveReleaseTag "NPM" $PublicArtifactLocation
117+
$releaseTag = RetrieveReleaseTag $PublicArtifactLocation
102118
Upload-Blobs -DocDir "$($DocLocation)/documentation/$($Item.BaseName)/$($Item.BaseName)/$($DocVersion)" -PkgName $PkgName -DocVersion $DocVersion -ReleaseTag $releaseTag
103119
}
104120
else

0 commit comments

Comments
 (0)