From 3a26e88deb109cf1c7e7b25bf849fcbbb07b50e8 Mon Sep 17 00:00:00 2001 From: David Fowler Date: Tue, 20 Oct 2015 15:36:59 -0700 Subject: [PATCH] Fixed to colors --- .../Program.cs | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/Microsoft.DotNet.Tools.Compiler/Program.cs b/src/Microsoft.DotNet.Tools.Compiler/Program.cs index 027f44e7f..a4dec679e 100644 --- a/src/Microsoft.DotNet.Tools.Compiler/Program.cs +++ b/src/Microsoft.DotNet.Tools.Compiler/Program.cs @@ -87,8 +87,19 @@ namespace Microsoft.DotNet.Tools.Compiler // Print out dependency diagnostics foreach (var diag in context.LibraryManager.GetAllDiagnostics()) { - success &= diag.Severity != DiagnosticMessageSeverity.Error; - Console.WriteLine(diag.FormattedMessage); + switch (diag.Severity) + { + case DiagnosticMessageSeverity.Info: + Reporter.Error.WriteLine(diag.FormattedMessage); + break; + case DiagnosticMessageSeverity.Warning: + Reporter.Error.WriteLine(diag.FormattedMessage.Yellow().Bold()); + break; + case DiagnosticMessageSeverity.Error: + success = false; + Reporter.Error.WriteLine(diag.FormattedMessage.Red().Bold()); + break; + } } // If there were dependency errors don't bother compiling @@ -126,7 +137,7 @@ namespace Microsoft.DotNet.Tools.Compiler if (compileResult.ExitCode != 0) { - Console.Error.WriteLine($"Failed to compile dependency: {projectDependency.Identity.Name.Red().Bold()}"); + Console.Error.WriteLine($"Failed to compile dependency: {projectDependency.Identity.Name.Red()}"); return false; } } @@ -220,7 +231,7 @@ namespace Microsoft.DotNet.Tools.Compiler if (result.ExitCode == 0) { - Reporter.Output.WriteLine($"Compiled {context.ProjectFile.Name} successfully!".Green().Bold()); + Reporter.Output.WriteLine($"Compiled {context.ProjectFile.Name} successfully!".Green()); return true; }