diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Hakyll/Commands.hs | 17 | ||||
-rw-r--r-- | src/Hakyll/Main.hs | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/Hakyll/Commands.hs b/src/Hakyll/Commands.hs index 0601909..7951f4e 100644 --- a/src/Hakyll/Commands.hs +++ b/src/Hakyll/Commands.hs @@ -65,9 +65,13 @@ clean conf = do -- | Preview the site preview :: Configuration -> Verbosity -> Rules a -> Int -> IO () #ifdef PREVIEW_SERVER -preview _ _ _ _ = mapM_ putStrLn [ "The preview command has been deprecated." - , "Use the watch command for recompilation and serving." - , "You can disable the server with watch --no-server"] +preview conf verbosity rules port = do + deprecatedMessage + watch conf verbosity port True rules + where + deprecatedMessage = mapM_ putStrLn [ "The preview command has been deprecated." + , "Use the watch command for recompilation and serving." + ] #else preview _ _ _ _ = previewServerDisabled #endif @@ -87,12 +91,9 @@ watch conf verbosity port runServer rules = do (_, ruleSet) <- run conf verbosity rules return $ rulesPattern ruleSet - server' :: IO () - server' = if runServer - then (server conf port) - else (return ()) - loop = threadDelay 100000 >> loop + + server' = if runServer then server conf port else return () #else watch _ _ _ _ _ = watchServerDisabled #endif diff --git a/src/Hakyll/Main.hs b/src/Hakyll/Main.hs index b8e0444..4b30939 100644 --- a/src/Hakyll/Main.hs +++ b/src/Hakyll/Main.hs @@ -87,7 +87,7 @@ hakyllArgs = modes , (Server (verboseFlag def) (portFlag 8000)) &= help "Start a preview server" , (Watch (verboseFlag def) (portFlag 8000) (noServerFlag False) &= - help "Autocompile on changes and start a preview server") + help "Autocompile on changes and start a preview server. You can watch and recompile without running a server with --no-server.") ] &= help "Hakyll static site compiler" &= program progName |