From 59dba8c3723398ba72f560d9a7a826f69c98974a Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Fri, 2 Oct 2015 15:42:55 -0500 Subject: [PATCH] (maint) Don't print chocolatey version every cmd 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. --- src/chocolatey.console/Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/chocolatey.console/Program.cs b/src/chocolatey.console/Program.cs index 5dceaf3b2a..b2e573b283 100644 --- a/src/chocolatey.console/Program.cs +++ b/src/chocolatey.console/Program.cs @@ -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) {