From 30eadae14dcc77674e5329736d3371c7d11d26b4 Mon Sep 17 00:00:00 2001 From: JohnMcPMS Date: Fri, 17 Sep 2021 15:13:12 -0700 Subject: [PATCH] Make list show correlated source even when no upgrade is available --- .../Workflows/WorkflowBase.cpp | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp index 1e52c80b9e..9acf4ce6a9 100644 --- a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp +++ b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -552,11 +552,16 @@ namespace AppInstaller::CLI::Workflow { Utility::LocIndString availableVersion, sourceName; - if (updateAvailable) + if (latestVersion) { - availableVersion = latestVersion->GetProperty(PackageVersionProperty::Version); + if (updateAvailable) + { + availableVersion = latestVersion->GetProperty(PackageVersionProperty::Version); + availableUpgradesCount++; + } + + // Always show the source for correlated packages sourceName = latestVersion->GetProperty(PackageVersionProperty::SourceName); - availableUpgradesCount++; } table.OutputLine({ @@ -575,14 +580,20 @@ namespace AppInstaller::CLI::Workflow if (table.IsEmpty()) { context.Reporter.Info() << Resource::String::NoInstalledPackageFound << std::endl; - } else if (m_onlyShowUpgrades) { - context.Reporter.Info() << availableUpgradesCount << ' ' << Resource::String::AvailableUpgrades << std::endl; } - - if (searchResult.Truncated) + else { - context.Reporter.Info() << '<' << Resource::String::SearchTruncated << '>' << std::endl; + if (searchResult.Truncated) + { + context.Reporter.Info() << '<' << Resource::String::SearchTruncated << '>' << std::endl; + } + + if (m_onlyShowUpgrades) + { + context.Reporter.Info() << availableUpgradesCount << ' ' << Resource::String::AvailableUpgrades << std::endl; + } } + } void EnsureMatchesFromSearchResult::operator()(Execution::Context& context) const