2024-09-23 21:14:18 +02:00
|
|
|
{-# LANGUAGE TemplateHaskell #-}
|
2024-09-11 22:32:14 +02:00
|
|
|
module Main where
|
|
|
|
|
2024-09-24 22:14:47 +02:00
|
|
|
import Types.Dependency (Dependency, formatDependencyTrees)
|
2024-09-23 22:11:54 +02:00
|
|
|
import DependencyGenerator (evalDepGenM)
|
|
|
|
import SiteGenerator (generateSite)
|
2024-09-27 21:18:29 +02:00
|
|
|
import DependencyRunner (runDeps, runDepRunMIO)
|
2024-09-21 16:35:13 +02:00
|
|
|
|
2024-09-27 21:18:29 +02:00
|
|
|
import System.Environment (getArgs)
|
2024-09-24 22:14:47 +02:00
|
|
|
import qualified Data.Text.IO as T
|
2024-09-23 22:11:54 +02:00
|
|
|
import Language.Haskell.TH.Syntax (lift)
|
2024-09-21 22:40:17 +02:00
|
|
|
|
2024-09-23 22:11:54 +02:00
|
|
|
dependencies :: [Dependency]
|
|
|
|
dependencies = $(lift (evalDepGenM generateSite))
|
2024-09-21 16:35:13 +02:00
|
|
|
|
2024-09-11 22:32:14 +02:00
|
|
|
main :: IO ()
|
2024-09-27 21:18:29 +02:00
|
|
|
main = do
|
|
|
|
args <- getArgs
|
|
|
|
case args of
|
|
|
|
["run"] ->
|
|
|
|
runDepRunMIO $ runDeps dependencies
|
|
|
|
["tree"] ->
|
|
|
|
T.putStr $ formatDependencyTrees dependencies
|
|
|
|
_ ->
|
|
|
|
error "unexpected arguments"
|