From 1d690c738d6b564fb20b1a0c5b40eb17b4951d89 Mon Sep 17 00:00:00 2001 From: CreepyCrafter24 <33260128+CreepyCrafter24@users.noreply.github.com> Date: Tue, 7 Apr 2020 21:26:16 +0200 Subject: [PATCH] Add update count to UpTool2-update --- UpToolCLI/Program.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/UpToolCLI/Program.cs b/UpToolCLI/Program.cs index 41bf740..1889b32 100644 --- a/UpToolCLI/Program.cs +++ b/UpToolCLI/Program.cs @@ -104,7 +104,16 @@ namespace UpToolCLI { Console.WriteLine("Fetching Repos..."); RepoManagement.FetchRepos(); - Console.WriteLine("Done!"); + RepoManagement.GetReposFromDisk(); + Console.WriteLine(); + IEnumerable tmp = GlobalVariables.Apps.Where(s => + (s.Value.status & Status.Updatable) == Status.Updatable).Select(s => s.Value); + IEnumerable apps = tmp as App[] ?? tmp.ToArray(); + int updatableCount = apps.Count(); + Console.WriteLine(updatableCount == 0 + ? "All up-to-date" + : $@"Found {updatableCount} Updates: +{string.Join(Environment.NewLine, apps.Select(s => $"- {s.Name} ({s.Version})"))}"); } private static void List()