mad/byg/app/Main.hs

27 lines
698 B
Haskell
Raw Normal View History

2024-09-11 22:32:14 +02:00
module Main where
import Byg.Types (Dependency)
import qualified Byg.DependencyRunner as DR
2024-11-09 22:55:42 +01:00
import qualified Byg.DependencyFormatter as DF
import Byg.DependencyGenerator (evalDepGenM)
import SiteGenerator (generateSite)
import System.Environment (getArgs)
import qualified Data.Text.IO as T
dependencies :: [Dependency]
dependencies = evalDepGenM generateSite
2024-09-11 22:32:14 +02:00
main :: IO ()
main = do
args <- getArgs
case args of
2024-11-27 20:49:17 +01:00
[] -> do
((), filesWritten) <- DR.runDepRunMIO $ DR.runDeps dependencies
putStrLn ("Files which could have been written: " ++ show filesWritten)
["tree"] ->
2024-11-09 22:55:42 +01:00
T.putStr $ DF.formatDependencyTrees dependencies
_ ->
error "unexpected arguments"