module Network.Wai.Herringbone.Configuration where
import Network.Wai.Herringbone.Types
import Filesystem.Path.CurrentOS (FilePath)
import Prelude hiding (FilePath)
herringbone :: ConfigBuilder -> Herringbone
herringbone builder = builder defaultHerringbone
type ConfigBuilder = Herringbone -> Herringbone
addSourceDir :: FilePath -> ConfigBuilder
addSourceDir dir hb = hb { hbSourceDirs = dir : hbSourceDirs hb }
setDestDir :: FilePath -> ConfigBuilder
setDestDir dir hb = hb { hbDestDir = dir }
addPreprocessors :: [PP] -> ConfigBuilder
addPreprocessors ppList hb = hb { hbPPs = insertAllPPs ppList (hbPPs hb) }
defaultHerringbone :: Herringbone
defaultHerringbone = Herringbone
{ hbSourceDirs = []
, hbDestDir = error "herringbone: destination dir must be specified"
, hbPPs = noPPs
}