Skip to content

Commit

Permalink
Make list show correlated source even when no upgrade is available (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnMcPMS authored Sep 18, 2021
1 parent 2e285f1 commit dac49cd
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions src/AppInstallerCLICore/Workflows/WorkflowBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -673,11 +673,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({
Expand All @@ -696,14 +701,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
Expand Down

0 comments on commit dac49cd

Please sign in to comment.