Skip to content

Commit b2a1cc8

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 afbad9f commit b2a1cc8

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
@@ -956,7 +956,7 @@ public virtual ConcurrentDictionary<string, PackageResult> get_outdated(Chocolat
956956
/// <param name="config">The configuration.</param>
957957
/// <param name="packageInfo">The package information.</param>
958958
/// <returns>The original unmodified configuration, so it can be reset after upgrade</returns>
959-
protected virtual ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo)
959+
public virtual ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo)
960960
{
961961
if (!config.Features.UseRememberedArgumentsForUpgrades || string.IsNullOrWhiteSpace(packageInfo.Arguments)) return config;
962962

0 commit comments

Comments
 (0)