Created
November 16, 2022 12:30
-
-
Save SteveGilham/c293562b670ad5d705b4efb7bc1aee2d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let paramsToEnvironment (o: DotNet.Options) = | |
o.CustomParams | |
|> Option.map (fun x -> let bits = x.Split ("/p:", StringSplitOptions.RemoveEmptyEntries) | |
bits | |
|> Array.fold (fun (o2: DotNet.Options) flag -> let line = flag.TrimEnd([| ' '; '"' |]) | |
let split = if line.Contains "=\"" | |
then "=\"" | |
else "=" | |
let parts = line.Split (split, StringSplitOptions.RemoveEmptyEntries) | |
{ o2 with Environment = o2.Environment |> Map.add parts[0] parts[1] }) o) | |
|> Option.defaultValue o | |
let testWithEnvironment (o: Fake.DotNet.DotNet.TestOptions) = | |
{o with Common = {paramsToEnvironment o.Common with CustomParams = None }} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment