-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.hs
More file actions
22 lines (17 loc) · 677 Bytes
/
Copy pathMain.hs
File metadata and controls
22 lines (17 loc) · 677 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Main where
import Control.Monad
import System.Directory
import System.Environment
import System.FilePath
import PageParser (parseFile)
import RssPrinter (toRss)
getAllFiles root = do names <- clean `fmap` getDirectoryContents root
let paths = map (root </>) names
dirs <- filterM doesDirectoryExist paths
files <- filterM doesFileExist paths
deeper <- mapM getAllFiles dirs
return (files ++ concat deeper)
where clean = filter (\fn -> fn /= "." && fn /= "..")
main = do [root] <- getArgs
blog <- parseFile root
putStrLn $ toRss blog