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
import qualified Byg.Types.Dependency as D
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
["run"] -> do
((), filesWritten) <- DR.runDepRunMIO $ DR.runDeps dependencies
putStrLn ("Files which could have been written: " ++ show filesWritten)
["tree"] ->
T.putStr $ D.formatDependencyTrees dependencies
_ ->
error "unexpected arguments"