Skip to content

Commit

Permalink
(chocolatey#2503) Make Nuget service method public
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
TheCakeIsNaOH committed Jun 27, 2022
1 parent b43dee2 commit 6b96a54
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/chocolatey/infrastructure.app/services/INugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ namespace chocolatey.infrastructure.app.services
using System.Collections.Concurrent;
using System.Collections.Generic;
using configuration;
using domain;
using results;

public interface INugetService : ISourceRunner
Expand Down Expand Up @@ -65,5 +66,13 @@ public interface INugetService : ISourceRunner
/// </summary>
/// <param name="config">The configuration</param>
IEnumerable<PackageResult> get_all_installed_packages(ChocolateyConfiguration config);

/// <summary>
/// Sets the configuration for the package upgrade
/// </summary>
/// <param name="config">The configuration.</param>
/// <param name="packageInfo">The package information.</param>
/// <returns>The original unmodified configuration, so it can be reset after upgrade</returns>
ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo);
}
}
2 changes: 1 addition & 1 deletion src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -962,7 +962,7 @@ public virtual ConcurrentDictionary<string, PackageResult> get_outdated(Chocolat
/// <param name="config">The configuration.</param>
/// <param name="packageInfo">The package information.</param>
/// <returns>The original unmodified configuration, so it can be reset after upgrade</returns>
protected virtual ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo)
public virtual ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo)
{
if (!config.Features.UseRememberedArgumentsForUpgrades || string.IsNullOrWhiteSpace(packageInfo.Arguments)) return config;

Expand Down

0 comments on commit 6b96a54

Please sign in to comment.