diff --git a/src/app/FakeLib/EnvironmentHelper.fs b/src/app/FakeLib/EnvironmentHelper.fs index b35f21b59ee..af4cc8a7e5d 100644 --- a/src/app/FakeLib/EnvironmentHelper.fs +++ b/src/app/FakeLib/EnvironmentHelper.fs @@ -49,6 +49,12 @@ let environVarOrDefault name defaultValue = if String.IsNullOrEmpty var then defaultValue else var +/// Retrieves the environment variable with the given name or fails if not found +let environVarOrFail name = + let var = environVar name + if String.IsNullOrEmpty var then failwith <| sprintf "Environment variable '%s' not found" name + else var + /// Retrieves the environment variable with the given name or returns the default bool if no value was set let getEnvironmentVarAsBoolOrDefault varName defaultValue= try