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 Jun 27, 2022
1 parent 9f6c88a commit 2c9f8db
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 @@ -779,6 +779,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 2c9f8db

Please sign in to comment.