mad/byg/src/Main.hs

29 lines
687 B
Haskell
Raw Normal View History

{-# LANGUAGE TemplateHaskell #-}
2024-09-11 22:32:14 +02:00
module Main where
2024-09-23 22:11:54 +02:00
import DependencyGenerator (evalDepGenM)
import SiteGenerator (generateSite)
2024-10-05 15:35:52 +02:00
import qualified Precomputer
import System.Environment (getArgs)
2024-10-05 15:35:52 +02:00
import Data.Text (Text)
import qualified Data.Text.IO as T
2024-10-05 15:35:52 +02:00
import Language.Haskell.TH.Syntax
2024-09-21 22:40:17 +02:00
2024-10-05 15:35:52 +02:00
formatDependencyTrees :: Text
formatDependencyTrees = $$(Precomputer.formatDependencyTrees $(lift (evalDepGenM generateSite)))
runDeps :: IO ()
runDeps = $$(Precomputer.runDeps $(lift (evalDepGenM generateSite)))
2024-09-11 22:32:14 +02:00
main :: IO ()
main = do
args <- getArgs
case args of
["run"] ->
2024-10-05 15:35:52 +02:00
runDeps
["tree"] ->
2024-10-05 15:35:52 +02:00
T.putStr formatDependencyTrees
_ ->
error "unexpected arguments"