winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit b357fe885fe3fa566bfa5d9ae9b0fdb75a2542d0
parent b96dbdbe718b6a307ff9655c5e414083aa04d6d1
Author: Muhammad Danish <mdanishkhdev@gmail.com>
Date:   Fri, 20 Oct 2023 04:26:30 +0500

Skip dependency evaluation with `--skip-dependencies` (#3784)


Diffstat:
Msrc/AppInstallerCLICore/Workflows/DependenciesFlow.cpp | 8++++++--
Msrc/AppInstallerCLITests/InstallDependenciesFlow.cpp | 2--
2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp b/src/AppInstallerCLICore/Workflows/DependenciesFlow.cpp @@ -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>(); @@ -344,4 +349,4 @@ namespace AppInstaller::CLI::Workflow context.Add<Execution::Data::PackageSubContexts>(std::move(dependencyPackageContexts)); } -}- \ No newline at end of file +} diff --git a/src/AppInstallerCLITests/InstallDependenciesFlow.cpp b/src/AppInstallerCLITests/InstallDependenciesFlow.cpp @@ -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); @@ -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());