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