Summary
Checks for the existence of a value for a given environment variable.
Syntax
[CakeMethodAlias]
[CakeAliasCategory("Environment Variables")]
public static bool HasEnvironmentVariable(this ICakeContext context, string variable)
Examples
if (HasEnvironmentVariable("SOME_ENVIRONMENT_VARIABLE"))
{
Information("The environment variable was present.");
}
Attributes
Parameters
Name |
Type |
Description |
context |
ICakeContext |
The context. |
variable |
string |
The environment variable. |
Return Value
Type |
Description |
bool |
true if the environment variable exist; otherwise false .
|