fix OSX issue in VSO build
also, make it possible to have more verbose build runs when needed
This commit is contained in:
parent
7da4573613
commit
9f3727d1a7
6 changed files with 56 additions and 21 deletions
32
scripts/dotnet-cli-build/Utils/EnvVars.cs
Normal file
32
scripts/dotnet-cli-build/Utils/EnvVars.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
|
||||
namespace Microsoft.DotNet.Cli.Build
|
||||
{
|
||||
public class EnvVars
|
||||
{
|
||||
public static readonly bool Verbose = GetBool("DOTNET_BUILD_VERBOSE");
|
||||
|
||||
private static bool GetBool(string name, bool defaultValue = false)
|
||||
{
|
||||
var str = Environment.GetEnvironmentVariable(name);
|
||||
if (string.IsNullOrEmpty(str))
|
||||
{
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
switch (str.ToLowerInvariant())
|
||||
{
|
||||
case "true":
|
||||
case "1":
|
||||
case "yes":
|
||||
return true;
|
||||
case "false":
|
||||
case "0":
|
||||
case "no":
|
||||
return false;
|
||||
default:
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue