Skip to content

Commit

Permalink
(GH-1397) Check for prerelease version if installed package is prerel…
Browse files Browse the repository at this point in the history
…ease.
  • Loading branch information
DamianMaslanka5 committed Feb 21, 2018
1 parent e39afd8 commit ecc88e4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,9 @@ public ConcurrentDictionary<string, PackageResult> get_outdated(ChocolateyConfig

IQueryable<IPackage> results = repository.GetPackages().Where(x => x.Id == packageName);

if (config.Prerelease && repository.SupportsPrereleasePackages)
var isPrerelease = !string.IsNullOrWhiteSpace(installedPackage.Version.SpecialVersion);

if (isPrerelease && repository.SupportsPrereleasePackages)
{
results = results.Where(p => p.IsAbsoluteLatestVersion);
}
Expand All @@ -895,7 +897,7 @@ public ConcurrentDictionary<string, PackageResult> get_outdated(ChocolateyConfig
{
results = results
.Where(PackageExtensions.IsListed)
.Where(p => config.Prerelease || p.IsReleaseVersion())
.Where(p => isPrerelease || p.IsReleaseVersion())
.AsQueryable();
}

Expand Down

0 comments on commit ecc88e4

Please sign in to comment.