Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/AppInstallerCLICore/Workflows/WorkflowBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -973,7 +973,13 @@ namespace AppInstaller::CLI::Workflow

if (!searchResult.Failures.empty())
{
if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::TreatSourceFailuresAsWarning))
// When the install command finds exactly one result from working sources, auto-proceed
// instead of requiring the user to specify --source.
bool singleResultOnPartialFailure =
WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::ShowSearchResultsOnPartialFailure) &&
searchResult.Matches.size() == 1;

if (WI_IsFlagSet(context.GetFlags(), Execution::ContextFlag::TreatSourceFailuresAsWarning) || singleResultOnPartialFailure)
Comment thread
Sinan-Karakaya marked this conversation as resolved.
Outdated
Comment thread
Sinan-Karakaya marked this conversation as resolved.
Outdated
{
auto warn = context.Reporter.Warn();
for (const auto& failure : searchResult.Failures)
Expand Down
Loading