web: avoid a fromJust error when running with yesod devel (not working yet)
This commit is contained in:
		
							parent
							
								
									7742bd2104
								
							
						
					
					
						commit
						9ffd34687a
					
				| @ -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 () | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user