Skip to content

Commit

Permalink
fix bug in prepare relaease (#2267)
Browse files Browse the repository at this point in the history
This handles cases where the package is beign released for the first time. i.e there is no previously existing versions.
  • Loading branch information
chidozieononiwu authored Nov 16, 2021
1 parent 463ba87 commit 65835fe
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions eng/common/scripts/Prepare-Release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ Write-Host "Assuming release is in $month with release date $releaseDateString"
if (Test-Path "Function:GetExistingPackageVersions")
{
$releasedVersions = GetExistingPackageVersions -PackageName $packageProperties.Name -GroupId $packageProperties.Group
$latestReleasedVersion = $releasedVersions[$releasedVersions.Count - 1]
Write-Host "Latest released version: ${latestReleasedVersion}" -ForegroundColor Green
if ($null -ne $releasedVersions -and $releasedVersions.Count -gt 0)
{
$latestReleasedVersion = $releasedVersions[$releasedVersions.Count - 1]
Write-Host "Latest released version: ${latestReleasedVersion}" -ForegroundColor Green
}
}

$currentProjectVersion = $packageProperties.Version
Expand Down

0 comments on commit 65835fe

Please sign in to comment.