Skip to content

Commit

Permalink
(maint) Don't print chocolatey version every cmd
Browse files Browse the repository at this point in the history
It can get confusing with some commands that return search results.

If we are on a debug build or a build that is not matched with the
version we think we should be on, do proceed with logging the
version.
  • Loading branch information
ferventcoder committed Oct 2, 2015
1 parent 03ec70b commit 59dba8c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/chocolatey.console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@ private static void Main(string[] args)
if (config.RegularOutput)
{
"logfile".Log().Info(() => "".PadRight(60, '='));

#if DEBUG
"chocolatey".Log().Info(ChocolateyLoggers.Important, () => "{0} v{1} (DEBUG BUILD)".format_with(ApplicationParameters.Name, config.Information.ChocolateyProductVersion));
#else
"chocolatey".Log().Info(ChocolateyLoggers.Important, () => "{0} v{1}".format_with(ApplicationParameters.Name, config.Information.ChocolateyProductVersion));
var versionLog = config.Information.ChocolateyVersion == config.Information.ChocolateyProductVersion ? "logfile" : "chocolatey";
versionLog.Log().Info(ChocolateyLoggers.Important, () => "{0} v{1}".format_with(ApplicationParameters.Name, config.Information.ChocolateyProductVersion));
#endif
}


if (warnings.Count != 0 && config.RegularOutput)
{
Expand Down

0 comments on commit 59dba8c

Please sign in to comment.