Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow FSI evaluation option for FSharp.Formatting. #2158

Merged
merged 1 commit into from
Oct 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions src/app/Fake.DotNet.FSFormatting/FSFormatting.fs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,17 @@ type LiterateArguments =
OutputDirectory : string
Template : string
ProjectParameters : (string * string) list
LayoutRoots : string list }
LayoutRoots : string list
FsiEval : bool }

let defaultLiterateArguments =
{ ToolPath = toolPath
Source = ""
OutputDirectory = ""
Template = ""
ProjectParameters = []
LayoutRoots = [] }
LayoutRoots = []
FsiEval = false }

let createDocs p =
let arguments = (p:LiterateArguments->LiterateArguments) defaultLiterateArguments
Expand All @@ -45,14 +47,15 @@ let createDocs p =
let source = arguments.Source
let template = arguments.Template
let outputDir = arguments.OutputDirectory
let fsiEval = if arguments.FsiEval then [ "--fsieval" ] else []

let command =
arguments.ProjectParameters
|> Seq.map (fun (k, v) -> [ k; v ])
|> Seq.concat
|> Seq.append
(["literate"; "--processdirectory" ] @ layoutroots @ [ "--inputdirectory"; source; "--templatefile"; template;
"--outputDirectory"; outputDir; "--replacements" ])
"--outputDirectory"; outputDir] @ fsiEval @ [ "--replacements" ])
|> Seq.map (fun s ->
if s.StartsWith "\"" then s
else sprintf "\"%s\"" s)
Expand Down