Skip to content

Commit

Permalink
Skip dependency evaluation with --skip-dependencies (#3784)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdanish-kh committed Oct 19, 2023
1 parent b96dbdb commit b357fe8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ namespace AppInstaller::CLI::Workflow

void CreateDependencySubContexts::operator()(Execution::Context& context) const
{
if (Settings::User().Get<Settings::Setting::InstallSkipDependencies>() || context.Args.Contains(Execution::Args::Type::SkipDependencies))
{
return;
}

auto info = context.Reporter.Info();
auto error = context.Reporter.Error();
const auto& rootManifest = context.Get<Execution::Data::Manifest>();
Expand Down Expand Up @@ -344,4 +349,4 @@ namespace AppInstaller::CLI::Workflow

context.Add<Execution::Data::PackageSubContexts>(std::move(dependencyPackageContexts));
}
}
}
2 changes: 0 additions & 2 deletions src/AppInstallerCLITests/InstallDependenciesFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ TEST_CASE("InstallerWithDependencies_SkipDependencies", "[dependencies]")
TestContext context{ installOutput, std::cin };
auto previousThreadGlobals = context.SetForCurrentThread();
OverrideForShellExecute(context);
OverrideOpenDependencySource(context);

context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("Installer_Exe_Dependencies.yaml").GetPath().u8string());
context.Args.AddArg(Execution::Args::Type::SkipDependencies);
Expand All @@ -208,7 +207,6 @@ TEST_CASE("InstallerWithDependencies_IgnoreDependenciesSetting", "[dependencies]
TestContext context{ installOutput, std::cin };
auto previousThreadGlobals = context.SetForCurrentThread();
OverrideForShellExecute(context);
OverrideOpenDependencySource(context);

context.Args.AddArg(Execution::Args::Type::Manifest, TestDataFile("Installer_Exe_Dependencies.yaml").GetPath().u8string());

Expand Down

0 comments on commit b357fe8

Please sign in to comment.