27 lines
698 B
Haskell
27 lines
698 B
Haskell
module Main where
|
|
|
|
import Byg.Types (Dependency)
|
|
import qualified Byg.DependencyRunner as DR
|
|
import qualified Byg.Types.Dependency as D
|
|
import Byg.DependencyGenerator (evalDepGenM)
|
|
|
|
import SiteGenerator (generateSite)
|
|
|
|
import System.Environment (getArgs)
|
|
import qualified Data.Text.IO as T
|
|
|
|
dependencies :: [Dependency]
|
|
dependencies = evalDepGenM generateSite
|
|
|
|
main :: IO ()
|
|
main = do
|
|
args <- getArgs
|
|
case args of
|
|
["run"] -> do
|
|
((), filesWritten) <- DR.runDepRunMIO $ DR.runDeps dependencies
|
|
putStrLn ("Files which could have been written: " ++ show filesWritten)
|
|
["tree"] ->
|
|
T.putStr $ D.formatDependencyTrees dependencies
|
|
_ ->
|
|
error "unexpected arguments"
|