public async Task Run(IGitDriver git, RepositoryData repository) { GitInit(git, repository); var updates = await FindPackageUpdateSets(git); availableUpdatesReporter.Report(repository.Pull.Name, updates); if (updates.Count == 0) { _logger.Terse("No potential updates found. Well done. Exiting."); return; } var targetUpdates = _updateSelection.SelectTargets(git, updates); if (updates.Count == 0) { _logger.Terse("No updates can be applied. Exiting."); return; } await _solutionsRestore.Restore(git.WorkingFolder); await UpdateAllTargets(git, repository, targetUpdates); _logger.Info($"Done {targetUpdates.Count} Updates"); }
public async Task Run(IGitDriver git, RepositoryData repository) { GitInit(git, repository); var updates = await _updateFinder.FindPackageUpdateSets(git.WorkingFolder); _logger.Verbose($"Report mode is {_settings.ReportMode}"); switch (_settings.ReportMode) { case ReportMode.Off: break; case ReportMode.On: // report and continue _availableUpdatesReporter.Report(repository.Pull.Name, updates); break; case ReportMode.ReportOnly: // report and exit _availableUpdatesReporter.Report(repository.Pull.Name, updates); _logger.Info("Exiting after reports only"); return; default: throw new Exception($"Unknown report mode: '{_settings.ReportMode}'"); } if (updates.Count == 0) { _logger.Terse("No potential updates found. Well done. Exiting."); return; } var targetUpdates = await _updateSelection.SelectTargets(repository.Push, updates); if (updates.Count == 0) { _logger.Terse("No updates can be applied. Exiting."); return; } await _solutionsRestore.Restore(git.WorkingFolder); await UpdateAllTargets(git, repository, targetUpdates); _logger.Info($"Done {targetUpdates.Count} Updates"); }
public async Task <int> Run( IGitDriver git, RepositoryData repository, SettingsContainer settings) { GitInit(git, repository); var sources = _nugetSourcesReader.Read(git.WorkingFolder, settings.UserSettings.NuGetSources); var updates = await _updateFinder.FindPackageUpdateSets( git.WorkingFolder, sources, settings.UserSettings.AllowedChange); _logger.Detailed($"Report mode is {settings.UserSettings.ReportMode}"); switch (settings.UserSettings.ReportMode) { case ReportMode.Off: break; case ReportMode.On: // report and continue _availableUpdatesReporter.Report(repository.Pull.Name, updates); break; case ReportMode.ReportOnly: // report and exit _availableUpdatesReporter.Report(repository.Pull.Name, updates); _logger.Normal("Exiting after reports only"); return(0); default: throw new Exception($"Unknown report mode: '{settings.UserSettings.ReportMode}'"); } if (updates.Count == 0) { _logger.Minimal("No potential updates found. Well done. Exiting."); return(0); } var targetUpdates = await _updateSelection.SelectTargets( repository.Push, updates, settings.PackageFilters); return(await DoTargetUpdates(git, repository, targetUpdates, sources, settings)); }