@@ -15,7 +15,7 @@ module EvaluatorHelpers =
1515
1616 let private sbOut = StringBuilder()
1717 let private sbErr = StringBuilder()
18- let internal fsi () =
18+ let internal fsi ( isWatch : bool ) =
1919 let refs =
2020 ProjectSystem.FSIRefs.getRefs ()
2121 |> List.map ( fun n -> sprintf " -r:%s " n)
@@ -29,8 +29,9 @@ module EvaluatorHelpers =
2929 let argv = [|
3030 yield ! refs
3131 yield " --noframework"
32- yield " /temp/fsi.exe" ;
33- yield " --define:FORNAX" |]
32+ if isWatch then yield " --define:WATCH"
33+ yield " --define:FORNAX"
34+ yield " /temp/fsi.exe" ; |]
3435 FsiEvaluationSession.Create( fsiConfig, argv, inStream, outStream, errStream)
3536 with
3637 | ex ->
@@ -180,12 +181,12 @@ module GeneratorEvaluator =
180181 |> Option.bind ( tryUnbox< string>)
181182 |> function
182183 | Some s -> Ok ( Encoding.UTF8.GetBytes s)
183- | None ->
184+ | None ->
184185 result
185186 |> Option.bind ( tryUnbox< byte[]>)
186187 |> function
187188 | Some bytes -> Ok bytes
188- | None ->
189+ | None ->
189190 sprintf " HTML generator %s couldn't be compiled" generatorPath |> Error)
190191
191192 ///`generatorPath` - absolute path to `.fsx` file containing the generator
@@ -200,7 +201,7 @@ module GeneratorEvaluator =
200201 result
201202 |> Option.bind ( tryUnbox<( string * string) list>)
202203 |> function
203- | Some files -> Ok ( files |> List.map ( fun ( o , r ) -> o, Encoding.UTF8.GetBytes r))
204+ | Some files -> Ok ( files |> List.map ( fun ( o , r ) -> o, Encoding.UTF8.GetBytes r))
204205 | None ->
205206 result
206207 |> Option.bind ( tryUnbox<( string * byte[]) list>)
@@ -421,7 +422,7 @@ module Logger =
421422 let errorfn str = Printf.kprintf ( fun s -> use c = consoleColor ConsoleColor.Red in printfn " %s " s) str
422423
423424///`projectRoot` - path to the root of website
424- let generateFolder ( projectRoot : string ) =
425+ let generateFolder ( projectRoot : string ) ( isWatch : bool ) =
425426
426427 let relative toPath fromPath =
427428 let toUri = Uri( toPath)
@@ -432,7 +433,7 @@ let generateFolder (projectRoot : string) =
432433 if projectRoot.EndsWith ( string Path.DirectorySeparatorChar) then projectRoot
433434 else projectRoot + ( string Path.DirectorySeparatorChar)
434435
435- use fsi = EvaluatorHelpers.fsi ()
436+ use fsi = EvaluatorHelpers.fsi ( isWatch )
436437 let sc = SiteContents ()
437438 let config =
438439 let configPath = Path.Combine( projectRoot, " config.fsx" )
0 commit comments