From 656726f3539fe1efa48a9dd4e5442b12f4594741 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Tue, 1 Mar 2022 00:14:12 -0300 Subject: [PATCH 1/3] Remove duplicated message when no upgrades --- src/AppInstallerCLICore/Workflows/UpdateFlow.cpp | 6 +----- src/AppInstallerCLICore/Workflows/WorkflowBase.cpp | 2 +- src/AppInstallerCLITests/WorkFlow.cpp | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/AppInstallerCLICore/Workflows/UpdateFlow.cpp b/src/AppInstallerCLICore/Workflows/UpdateFlow.cpp index b1eadd563e..0ebded708f 100644 --- a/src/AppInstallerCLICore/Workflows/UpdateFlow.cpp +++ b/src/AppInstallerCLICore/Workflows/UpdateFlow.cpp @@ -181,11 +181,7 @@ namespace AppInstaller::CLI::Workflow AddToPackagesToInstallIfNotPresent(packagesToInstall, std::move(updateContextPtr)); } - if (!updateAllFoundUpdate) - { - context.Reporter.Info() << Resource::String::UpdateNotApplicable << std::endl; - } - else + if (updateAllFoundUpdate) { context.Add(std::move(packagesToInstall)); context.Reporter.Info() << std::endl; diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp index e3d750bd6c..afab61bc2b 100644 --- a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp +++ b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -759,7 +759,7 @@ namespace AppInstaller::CLI::Workflow if (table.IsEmpty()) { - context.Reporter.Info() << Resource::String::NoInstalledPackageFound << std::endl; + context.Reporter.Info() << Resource::String::UpdateNotApplicable << std::endl; } else { diff --git a/src/AppInstallerCLITests/WorkFlow.cpp b/src/AppInstallerCLITests/WorkFlow.cpp index 8edc977151..99c9416ad0 100644 --- a/src/AppInstallerCLITests/WorkFlow.cpp +++ b/src/AppInstallerCLITests/WorkFlow.cpp @@ -1355,7 +1355,7 @@ TEST_CASE("UpdateFlow_UpdateWithManifestAppNotInstalled", "[UpdateFlow][workflow // Verify Installer is not called. REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); - REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::NoInstalledPackageFound).get()) != std::string::npos); + REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpdateNotApplicable).get()) != std::string::npos); REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_NO_APPLICATIONS_FOUND); } From 2b88218b7ac98d79d982cfa3190d8dd1100ae710 Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Tue, 1 Mar 2022 00:23:40 -0300 Subject: [PATCH 2/3] Restore message when not upgrade --- src/AppInstallerCLICore/Workflows/WorkflowBase.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp index afab61bc2b..97945aa958 100644 --- a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp +++ b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -759,7 +759,12 @@ namespace AppInstaller::CLI::Workflow if (table.IsEmpty()) { - context.Reporter.Info() << Resource::String::UpdateNotApplicable << std::endl; + if (m_onlyShowUpgrades) { + context.Reporter.Info() << Resource::String::UpdateNotApplicable << std::endl; + } + else { + context.Reporter.Info() << Resource::String::NoInstalledPackageFound << std::endl; + } } else { From 2c0b96a71e5bee41d8cbc6b82d153a888f59d8fb Mon Sep 17 00:00:00 2001 From: Felipe Santos Date: Wed, 2 Mar 2022 17:21:59 -0300 Subject: [PATCH 3/3] Restore original message --- src/AppInstallerCLICore/Workflows/WorkflowBase.cpp | 7 +------ src/AppInstallerCLITests/WorkFlow.cpp | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp index 97945aa958..e3d750bd6c 100644 --- a/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp +++ b/src/AppInstallerCLICore/Workflows/WorkflowBase.cpp @@ -759,12 +759,7 @@ namespace AppInstaller::CLI::Workflow if (table.IsEmpty()) { - if (m_onlyShowUpgrades) { - context.Reporter.Info() << Resource::String::UpdateNotApplicable << std::endl; - } - else { - context.Reporter.Info() << Resource::String::NoInstalledPackageFound << std::endl; - } + context.Reporter.Info() << Resource::String::NoInstalledPackageFound << std::endl; } else { diff --git a/src/AppInstallerCLITests/WorkFlow.cpp b/src/AppInstallerCLITests/WorkFlow.cpp index 99c9416ad0..8edc977151 100644 --- a/src/AppInstallerCLITests/WorkFlow.cpp +++ b/src/AppInstallerCLITests/WorkFlow.cpp @@ -1355,7 +1355,7 @@ TEST_CASE("UpdateFlow_UpdateWithManifestAppNotInstalled", "[UpdateFlow][workflow // Verify Installer is not called. REQUIRE(!std::filesystem::exists(updateResultPath.GetPath())); - REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::UpdateNotApplicable).get()) != std::string::npos); + REQUIRE(updateOutput.str().find(Resource::LocString(Resource::String::NoInstalledPackageFound).get()) != std::string::npos); REQUIRE(context.GetTerminationHR() == APPINSTALLER_CLI_ERROR_NO_APPLICATIONS_FOUND); }