web: avoid a fromJust error when running with yesod devel (not working yet)

This commit is contained in:
Simon Michael 2013-04-05 20:59:31 -07:00
parent 7742bd2104
commit 9ffd34687a

View File

@ -6,14 +6,20 @@ import Control.Concurrent (forkIO)
import System.Directory (doesFileExist, removeFile)
import System.Exit (exitSuccess)
import Control.Concurrent (threadDelay)
import System.IO.Storage (withStore, putValue)
import Hledger (readJournalFile)
main :: IO ()
main = do
putStrLn "Starting devel application"
(port, app) <- getApplicationDev
forkIO $ runSettings defaultSettings
{ settingsPort = port
} app
forkIO $
withStore "hledger" $ do
readJournalFile Nothing Nothing "dev.journal" >>= putValue "hledger" "journal"
runSettings defaultSettings
{ settingsPort = port
} app
loop
loop :: IO ()