Skip to content

Commit 6b96a54

Browse files
committed
(chocolatey#2503) Make Nuget service method public
Changes the set_package_config_for_upgrade method in the nuget service to be public so it can be accessed for purposes of parsing the saved arguments so they can be exported.
1 parent b43dee2 commit 6b96a54

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/chocolatey/infrastructure.app/services/INugetService.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ namespace chocolatey.infrastructure.app.services
1919
using System.Collections.Concurrent;
2020
using System.Collections.Generic;
2121
using configuration;
22+
using domain;
2223
using results;
2324

2425
public interface INugetService : ISourceRunner
@@ -65,5 +66,13 @@ public interface INugetService : ISourceRunner
6566
/// </summary>
6667
/// <param name="config">The configuration</param>
6768
IEnumerable<PackageResult> get_all_installed_packages(ChocolateyConfiguration config);
69+
70+
/// <summary>
71+
/// Sets the configuration for the package upgrade
72+
/// </summary>
73+
/// <param name="config">The configuration.</param>
74+
/// <param name="packageInfo">The package information.</param>
75+
/// <returns>The original unmodified configuration, so it can be reset after upgrade</returns>
76+
ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo);
6877
}
6978
}

src/chocolatey/infrastructure.app/services/NugetService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ public virtual ConcurrentDictionary<string, PackageResult> get_outdated(Chocolat
962962
/// <param name="config">The configuration.</param>
963963
/// <param name="packageInfo">The package information.</param>
964964
/// <returns>The original unmodified configuration, so it can be reset after upgrade</returns>
965-
protected virtual ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo)
965+
public virtual ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo)
966966
{
967967
if (!config.Features.UseRememberedArgumentsForUpgrades || string.IsNullOrWhiteSpace(packageInfo.Arguments)) return config;
968968

0 commit comments

Comments
 (0)