-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e58fa0
commit 0eb7659
Showing
4 changed files
with
49 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -271,3 +271,6 @@ coverage.*.xml | |
.ionide | ||
|
||
docs/coverage | ||
|
||
# Environment file | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
namespace BuildHelper | ||
|
||
module DotEnv = | ||
open Fake.Core | ||
open System | ||
open System.IO | ||
|
||
let private parseLine (line: string) = | ||
match line.Split('=', StringSplitOptions.RemoveEmptyEntries) with | ||
| args when args.Length = 2 -> Environment.SetEnvironmentVariable(args.[0], args.[1]) | ||
| _ -> () | ||
|
||
let load (rootDir) = | ||
let filePath = Path.Combine(rootDir, ".env") | ||
|
||
if File.Exists filePath then | ||
filePath | ||
|> File.ReadAllLines | ||
|> Seq.iter parseLine | ||
else | ||
Trace.traceImportantfn "No .env file found. %s" rootDir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters