Skip to content

Commit

Permalink
(chocolateyGH-1155) Fix: params are unused w/nupkg
Browse files Browse the repository at this point in the history
When using nuspec or nupkg, it doesn't translate to the package name
that is being installed, so it determines that the name. See if the
name contains the package id along with the nupkg, nuspec or a file
path of some sort.
  • Loading branch information
ferventcoder committed Aug 27, 2017
1 parent 0a3ff6c commit e91f209
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/chocolatey/infrastructure.app/services/PowershellService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,15 @@ private bool package_is_a_dependency_not_a_virtual(ChocolateyConfiguration confi
{
foreach (var package in config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null())
{
if (packageName.is_equal_to(package) || packageName.contains(package + "."))
if (packageName.is_equal_to(package)
|| packageName.contains(package + ".")
|| (packageName.contains(package)
&& (packageName.contains(".nupkg")
|| packageName.contains(".nuspec")
|| packageName.contains("\\")
)
)
)
{
return false;
}
Expand Down

0 comments on commit e91f209

Please sign in to comment.