Skip to content

Commit

Permalink
(maint) virtualize get_package_information
Browse files Browse the repository at this point in the history
In ChocolateyPackageService, virtualize getting package information.
  • Loading branch information
ferventcoder committed Feb 12, 2018
1 parent 8b30dfb commit 0c108f0
Showing 1 changed file with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,11 +335,7 @@ public void handle_package_result(PackageResult packageResult, ChocolateyConfigu

this.Log().Info("{0} package files {1} completed. Performing other installation steps.".format_with(packageResult.Name, commandName.to_string()));

var pkgInfo = _packageInfoService.get_package_information(packageResult.Package);
if (config.AllowMultipleVersions)
{
pkgInfo.IsSideBySide = true;
}
var pkgInfo = get_package_information(packageResult, config);

if (packageResult.Success && config.Information.PlatformType == PlatformType.Windows)
{
Expand Down Expand Up @@ -455,6 +451,17 @@ public void handle_package_result(PackageResult packageResult, ChocolateyConfigu
}
}

protected virtual ChocolateyPackageInformation get_package_information(PackageResult packageResult, ChocolateyConfiguration config)
{
var pkgInfo = _packageInfoService.get_package_information(packageResult.Package);
if (config.AllowMultipleVersions)
{
pkgInfo.IsSideBySide = true;
}

return pkgInfo;
}

protected virtual void update_package_information(ChocolateyPackageInformation pkgInfo)
{
_packageInfoService.save_package_information(pkgInfo);
Expand Down

0 comments on commit 0c108f0

Please sign in to comment.