on master help sign in
Friendlier output.
commit849b49aa53fcc50064854a44d34eb1cd04e502d3 authorJasper Van der Jeugt <jaspervdj@gmail.com> dateSun 27 Dec 2009, 19:45 (17 years ago) parent3221ff6
1 file changed+9−3
src/Text/Hakyll.hs+9−3
src/Text/Hakyll.hs+9−3
@@ -9,19 +9,25 @@ import System.Directory (doesDirectoryExist, removeDirectoryRecursive)
99
1010-- | Main function to run hakyll.
1111hakyll :: IO () -> IO ()
12−hakyll action = do
12+hakyll buildFunction = do
1313 args <- getArgs
14− case args of [] -> action
14+ case args of [] -> build buildFunction
1515 ["clean"] -> clean
1616 ["server", p] -> server (read p)
1717 ["server"] -> server 8000
1818 _ -> help
1919
20+-- | Build the site.
21+build :: IO () -> IO ()
22+build buildFunction = do putStrLn "Generating..."
23+ buildFunction
24+
2025-- | Clean up directories.
2126clean :: IO ()
2227clean = do remove' "_cache"
2328 remove' "_site"
24− where remove' dir = do exists <- doesDirectoryExist dir
29+ where remove' dir = do putStrLn $ "Removing " ++ dir ++ "..."
30+ exists <- doesDirectoryExist dir
2531 if exists then removeDirectoryRecursive dir
2632 else return ()
2733