Use Map for updating environment variables.

This ensures that the newly inserted variables overwrite any existing
variables. For more information, see:

https://groups.google.com/d/msg/yesodweb/0AX2GbKqmIk/nKYTCVoCm4QJ
This commit is contained in:
Michael Snoyman 2014-05-13 18:31:21 +03:00
parent 787d3c828d
commit cf20f15957
2 changed files with 5 additions and 2 deletions

View File

@ -276,7 +276,10 @@ devel opts passThroughArgs = withSocketsDo $ withManager $ \manager -> do
liftIO $ I.writeIORef iappPort appPort
(_,_,_,ph) <- liftIO $ createProcess (proc "runghc" devArgs)
{ env = Just $ ("PORT", show appPort) : ("DISPLAY_PORT", show $ develPort opts) : env0
{ env = Just $ Map.toList
$ Map.insert "PORT" (show appPort)
$ Map.insert "DISPLAY_PORT" (show $ develPort opts)
$ Map.fromList env0
}
derefMap <- get
watchTid <- liftIO . forkIO . try_ $ flip evalStateT derefMap $ do

View File

@ -1,5 +1,5 @@
name: yesod-bin
version: 1.2.9.1
version: 1.2.9.2
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>