Skip to content

Commit 18ba5de

Browse files
Update LanguageSettings.ps1 (Azure#12771)
* Add function for retrieving existing versions of packages * Add SetPackageVersion function * Update versioning tools * Add GetPackageInstallNotes function * Update eng/scripts/Language-Settings.ps1 Co-authored-by: Wes Haggard <weshaggard@users.noreply.github.com>
1 parent f6e9e96 commit 18ba5de

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

eng/scripts/Language-Settings.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,3 +241,19 @@ function SetPackageVersion ($PackageName, $Version, $ServiceDirectory = $null, $
241241
node ./set-version.js --artifact-name $PackageName --new-version $Version --release-date $ReleaseDate --repo-root $RepoRoot
242242
Pop-Location
243243
}
244+
245+
# PackageName: Pass full package name e.g. @azure/abort-controller
246+
# You can obtain full pacakge name using the 'Get-PkgProperties' function in 'eng\common\scripts\Package-Properties.Ps1'
247+
function GetExistingPackageVersions ($PackageName, $GroupId = $null)
248+
{
249+
try
250+
{
251+
$existingVersion = Invoke-RestMethod -Method GET -Uri "http://registry.npmjs.com/${PackageName}"
252+
return ($existingVersion.versions | Get-Member -MemberType NoteProperty).Name
253+
}
254+
catch
255+
{
256+
LogError "Failed to retrieve package versions. `n$_"
257+
return $null
258+
}
259+
}

0 commit comments

Comments
 (0)