Skip to content

Commit

Permalink
Change nugetize default to non-verbose
Browse files Browse the repository at this point in the history
We were showing MSBuild output for any nugetize run that took longer than 10 seconds. Diagnosing slow builds shouldn't be a nugetizer issue, and it makes it confusing to see potentially many warnings and what-not that are irrelevant to packing.

Make it so instead of asking for quiet, you can ask for verbose and get the output.

If there were errors running the tool, we'd still want to see the MSBuild output, though.
  • Loading branch information
kzu committed Feb 20, 2023
1 parent 4016310 commit e604130
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/dotnet-nugetize/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Program

bool binlog = Debugger.IsAttached;
bool debug = Debugger.IsAttached && Environment.GetEnvironmentVariable("DEBUG_NUGETIZER") != "0";
bool quiet = false;
bool verbose = false;
string items;
List<string> extra;

Expand Down Expand Up @@ -85,7 +85,7 @@ int Run(string[] args)
{ "?|h|help", "Display this help.", h => help = h != null },
{ "b|bl|binlog", "Generate binlog.", b => binlog = b != null },
{ "d|debug", "Debug nugetizer tasks.", d => debug = d != null, true },
{ "q|quiet", "Don't render MSBuild output.", q => quiet = q != null },
{ "v|verbose", "Render MSBuild output.", v => verbose = v != null },
{ "i|items:", "MSBuild items file path containing full package contents metadata.", i => items = Path.GetFullPath(i) },
{ "version", "Render tool version and copyright information.", v => version = v != null },
}
Expand Down Expand Up @@ -455,11 +455,10 @@ bool Execute(string program, string arguments) //=> AnsiConsole.Status().Start("
if (!timedout)
output.Append(proc.StandardOutput.ReadToEnd());

if (quiet)
return proc.ExitCode == 0;
if (!verbose && proc.ExitCode == 0)
return true;

if (timedout || proc.ExitCode != 0)
Console.Out.Write(output.ToString());
Console.Out.Write(output.ToString());

return proc.ExitCode == 0;
}
Expand Down

0 comments on commit e604130

Please sign in to comment.