Skip to content

Commit

Permalink
(chocolatey#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 9, 2022
1 parent 0379537 commit 933ad64
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 933ad64

Please sign in to comment.