Put program into a runnable state, and break the cycle that was discovered
This commit is contained in:
parent
c504f85a2d
commit
9d2d5b5522
8 changed files with 111 additions and 72 deletions
12
app/Main.hs
12
app/Main.hs
|
|
@ -1,7 +1,17 @@
|
|||
module Main(main) where
|
||||
|
||||
import CAStore.Command (runCommand)
|
||||
import CAStore.Config (finalConfig)
|
||||
import CAStore.Program (runProgram, defaultProgram)
|
||||
import CAStore.Program (Program, runProgram, getCommand)
|
||||
import CAStore.Program.Storage (initialise)
|
||||
import Control.Monad.IO.Class (liftIO)
|
||||
|
||||
main :: IO ()
|
||||
main = finalConfig >>= flip runProgram defaultProgram
|
||||
|
||||
defaultProgram :: Program ()
|
||||
defaultProgram = do
|
||||
initialise
|
||||
getCommand >>= \case
|
||||
Nothing -> liftIO $ putStrLn "ERROR: Invalid command"
|
||||
Just cmd -> runCommand cmd
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue