From 3fd71066ad5995489c545f351851ce4b3a1bb0fc Mon Sep 17 00:00:00 2001 From: Julien Adam Date: Thu, 27 Feb 2020 12:20:37 +0100 Subject: [PATCH 1/2] Added a command line param to specify the slides dir Allows users with many presentations to have only one fsreveal engine to maintain. --- build.fsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.fsx b/build.fsx index 99b39fcf..1e20d3aa 100644 --- a/build.fsx +++ b/build.fsx @@ -33,7 +33,7 @@ open Suave.Utils open Suave.Files let outDir = __SOURCE_DIRECTORY__ "output" -let slidesDir = __SOURCE_DIRECTORY__ "slides" +let slidesDir = getBuildParamOrDefault "input" (__SOURCE_DIRECTORY__ "slides") Target "Clean" (fun _ -> CleanDirs [outDir] From 9e02cf09b3fd8c587cb4e97d06c0364e9aa20430 Mon Sep 17 00:00:00 2001 From: Julien Adam Date: Sat, 11 Sep 2021 15:15:57 +0200 Subject: [PATCH 2/2] Fixed filesystem watch Changed string concat to path combine operator in a few places. This fixed the FS watcher problem --- build.fsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build.fsx b/build.fsx index 1e20d3aa..efbdc94d 100644 --- a/build.fsx +++ b/build.fsx @@ -123,18 +123,19 @@ let startWebServer () = Process.Start (sprintf "http://localhost:%d/index.html" port) |> ignore Target "GenerateSlides" (fun _ -> - !! (slidesDir + "/**/*.md") - ++ (slidesDir + "/**/*.fsx") + !! (slidesDir "**" "*.md") + ++ (slidesDir "**" "*.fsx") |> Seq.map fileInfo |> Seq.iter generateFor ) Target "KeepRunning" (fun _ -> - use watcher = !! (slidesDir + "/**/*.*") |> WatchChanges handleWatcherEvents + let watchSelection = slidesDir "**" "*.*" + use watcher = !! watchSelection |> WatchChanges handleWatcherEvents startWebServer () - traceImportant "Waiting for slide edits. Press any key to stop." + sprintf "Waiting for slide edits in %s. Press any key to stop." watchSelection |> traceImportant System.Console.ReadKey() |> ignore