Skip to content

Commit

Permalink
(#798) Add PinPackage element to packages.config
Browse files Browse the repository at this point in the history
This adds the PinPackages element to the deffinition of the
packages.config format. This allows the pin-packages argument
to be used via a config file.
  • Loading branch information
TheCakeIsNaOH committed Mar 21, 2022
1 parent 67d3de2 commit 5525d68
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,5 +158,8 @@ public sealed class PackagesConfigFilePackageSetting

[XmlAttribute(AttributeName = "noProgress")]
public bool NoProgress { get; set; }

[XmlAttribute(AttributeName = "pinPackage")]
public bool PinPackage { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,7 @@ private IEnumerable<ChocolateyConfiguration> get_packages_from_config(string pac
if (pkgSettings.FailOnStderr) packageConfig.Features.FailOnStandardError = true;
if (pkgSettings.UseSystemPowershell) packageConfig.Features.UsePowerShellHost = false;
if (pkgSettings.NoProgress) packageConfig.Features.ShowDownloadProgress = false;
if (pkgSettings.PinPackage) packageConfig.PinPackage = true;

this.Log().Info(ChocolateyLoggers.Important, @"{0}".format_with(packageConfig.PackageNames));
packageConfigs.Add(packageConfig);
Expand Down

0 comments on commit 5525d68

Please sign in to comment.