Skip to content

Commit

Permalink
(chocolateyGH-1155) More comprehensive warn on nupkg/nuspec use
Browse files Browse the repository at this point in the history
When using nupkg or nuspec, ensure the command checking is looking at
whether "pack " is being called instead of just seeing "pack" in
"package-parameters", which doesn't provide the warning it was designed
to provide.
  • Loading branch information
ferventcoder committed Aug 27, 2017
1 parent e91f209 commit e415817
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/chocolatey.console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ private static void Main(string[] args)

private static void warn_on_nuspec_or_nupkg_usage(string[] args, ChocolateyConfiguration config)
{
if (!args.Any(a => a.contains("pack") || a.contains("push")) && args.Any(a => a.contains(".nupkg") || a.contains(".nuspec")))
var commandLine = Environment.CommandLine;
if (!(commandLine.contains(" pack ") || commandLine.contains(" push ")) && (commandLine.contains(".nupkg") || commandLine.contains(".nuspec")))
{
if (config.RegularOutput) "chocolatey".Log().Warn("The use of .nupkg or .nuspec in for package name or source is known to cause issues. Please use the package id from the nuspec `<id />` with `-s .` (for local folder where nupkg is found).");
}
Expand Down

0 comments on commit e415817

Please sign in to comment.