mad/byg/src/Main.hs

29 lines
687 B
Haskell

{-# LANGUAGE TemplateHaskell #-}
module Main where
import DependencyGenerator (evalDepGenM)
import SiteGenerator (generateSite)
import qualified Precomputer
import System.Environment (getArgs)
import Data.Text (Text)
import qualified Data.Text.IO as T
import Language.Haskell.TH.Syntax
formatDependencyTrees :: Text
formatDependencyTrees = $$(Precomputer.formatDependencyTrees $(lift (evalDepGenM generateSite)))
runDeps :: IO ()
runDeps = $$(Precomputer.runDeps $(lift (evalDepGenM generateSite)))
main :: IO ()
main = do
args <- getArgs
case args of
["run"] ->
runDeps
["tree"] ->
T.putStr formatDependencyTrees
_ ->
error "unexpected arguments"