2024-09-11 22:32:14 +02:00
|
|
|
module Main where
|
|
|
|
|
2024-11-09 22:44:46 +01:00
|
|
|
import Byg.Types (Dependency)
|
|
|
|
import qualified Byg.DependencyRunner as DR
|
2024-11-09 22:55:42 +01:00
|
|
|
import qualified Byg.DependencyFormatter as DF
|
2024-11-09 22:44:46 +01:00
|
|
|
import Byg.DependencyGenerator (evalDepGenM)
|
|
|
|
|
2024-10-30 21:53:57 +01:00
|
|
|
import SiteGenerator (generateSite)
|
2024-09-21 16:35:13 +02:00
|
|
|
|
2024-09-27 21:18:29 +02:00
|
|
|
import System.Environment (getArgs)
|
2024-10-30 21:53:57 +01:00
|
|
|
import qualified Data.Text.IO as T
|
|
|
|
|
|
|
|
dependencies :: [Dependency]
|
|
|
|
dependencies = 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
|
2024-11-07 23:20:28 +01:00
|
|
|
["run"] -> do
|
|
|
|
((), filesWritten) <- DR.runDepRunMIO $ DR.runDeps dependencies
|
|
|
|
putStrLn ("Files which could have been written: " ++ show filesWritten)
|
2024-09-27 21:18:29 +02:00
|
|
|
["tree"] ->
|
2024-11-09 22:55:42 +01:00
|
|
|
T.putStr $ DF.formatDependencyTrees dependencies
|
2024-09-27 21:18:29 +02:00
|
|
|
_ ->
|
|
|
|
error "unexpected arguments"
|