Beispiel #1
0
        public IEnumerable <PackageForUpdate> GetPackagesForUpdate(string nugetSourceUrl)
        {
            nugetSourceUrl.CheckArgumentNullOrWhiteSpace(nameof(nugetSourceUrl));
            IEnumerable <PackageInfo>  applicationPackages             = _applicationPackageListProvider.GetPackages();
            IEnumerable <NugetPackage> nugetPackages                   = _nugetPackagesProvider.GetPackages(nugetSourceUrl);
            IEnumerable <string>       applicationPackagesNamesInNuget =
                GetApplicationPackagesNamesInNuget(applicationPackages, nugetPackages);

            return(GetPackagesForUpdate(applicationPackagesNamesInNuget, applicationPackages, nugetPackages));
        }
Beispiel #2
0
        public IEnumerable <PackageForUpdate> GetPackagesForUpdate(string nugetSourceUrl)
        {
            nugetSourceUrl.CheckArgumentNullOrWhiteSpace(nameof(nugetSourceUrl));
            IEnumerable <PackageInfo> applicationPackages = _applicationPackageListProvider.GetPackages();
            IEnumerable <string>      appPackagesNames    = applicationPackages
                                                            .Select(pkg => pkg.Descriptor.Name)
                                                            .Distinct();
            IEnumerable <LastVersionNugetPackages> appPackagesNamesInNuget =
                _nugetPackagesProvider.GetLastVersionPackages(appPackagesNames, nugetSourceUrl);

            return(GetPackagesForUpdate(applicationPackages, appPackagesNamesInNuget));
        }
Beispiel #3
0
 public override int Execute(PkgListOptions options)
 {
     try {
         IEnumerable <PackageInfo> packages = _applicationPackageListProvider.GetPackages();
         var filteredPackages = FilterPackages(packages, options.SearchPattern);
         if (filteredPackages.Any())
         {
             PrintPackageList(filteredPackages);
         }
         Console.WriteLine();
         Console.WriteLine($"Find {filteredPackages.Count()} packages in {_environmentSettings.Uri}");
         return(0);
     } catch (Exception e) {
         Console.WriteLine(e);
         return(1);
     }
 }