2017-03-02 21:04:03 -08:00
|
|
|
|
// Copyright (c) .NET Foundation and contributors. All rights reserved.
|
|
|
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
|
|
|
|
|
|
using System;
|
2016-03-24 22:24:31 -07:00
|
|
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli.Build
|
|
|
|
|
{
|
|
|
|
|
public class EnvVars
|
|
|
|
|
{
|
2016-05-18 14:14:50 -05:00
|
|
|
|
public static string EnsureVariable(string variableName)
|
|
|
|
|
{
|
|
|
|
|
string value = Environment.GetEnvironmentVariable(variableName);
|
|
|
|
|
if (string.IsNullOrEmpty(value))
|
|
|
|
|
{
|
|
|
|
|
throw new BuildFailureException($"'{variableName}' environment variable was not found.");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return value;
|
|
|
|
|
}
|
2016-03-24 22:24:31 -07:00
|
|
|
|
}
|
|
|
|
|
}
|