Skip to content

Commit

Permalink
(GH-1397) Support local source repository.
Browse files Browse the repository at this point in the history
  • Loading branch information
DamianMaslanka5 committed Feb 20, 2018
1 parent cad9943 commit cb0c781
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -862,11 +862,12 @@ public ConcurrentDictionary<string, PackageResult> get_outdated(ChocolateyConfig

foreach (var packageName in packageNames)
{
var latestPackage = packageManager.SourceRepository.GetPackages().Where(x => x.Id.ToLower() == packageName && x.IsLatestVersion).FirstOrDefault();
// LastOrDefault to get the latest package from local repository, because all packages have set IsLatestVersion to true
var latestPackage = packageManager.SourceRepository.GetPackages().Where(x => x.Id.ToLower() == packageName && x.IsLatestVersion).LastOrDefault();

if(latestPackage == null)
{
this.Log().Warn(packageName + " doesn't exists in the current source.");
this.Log().Warn(packageName + " doesn't exist in the current source.");
continue;
}

Expand Down

0 comments on commit cb0c781

Please sign in to comment.