Update Reporter in build.

This commit is contained in:
Bryan 2016-02-23 12:10:50 -08:00
parent 619eaa0c55
commit b2fab6df02
2 changed files with 9 additions and 28 deletions

View file

@ -19,16 +19,9 @@ namespace Microsoft.DotNet.Cli.Build.Framework
_console = console;
}
public static Reporter Output { get; } = Create(AnsiConsole.GetOutput);
public static Reporter Error { get; } = Create(AnsiConsole.GetOutput);
public static Reporter Verbose { get; } = Create(AnsiConsole.GetOutput);
public static Reporter Create(Func<bool, AnsiConsole> getter)
{
var stripColors = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ||
string.Equals(Environment.GetEnvironmentVariable("NO_COLOR"), "1");
return new Reporter(getter(stripColors));
}
public static Reporter Output { get; } = new Reporter(AnsiConsole.GetOutput());
public static Reporter Error { get; } = new Reporter(AnsiConsole.GetOutput());
public static Reporter Verbose { get; } = new Reporter(AnsiConsole.GetOutput());
public void WriteLine(string message)
{