Skip to content

Commit

Permalink
Merge pull request #814 from blair55/master
Browse files Browse the repository at this point in the history
added environVarOrFail function to EnvironmentHelper
  • Loading branch information
forki committed May 25, 2015
2 parents c784544 + a407f85 commit 7134725
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/app/FakeLib/EnvironmentHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7134725

Please sign in to comment.