From cf20f159574c797ef94f7cfade555b0ac96f152c Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 13 May 2014 18:31:21 +0300 Subject: [PATCH] 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 --- yesod-bin/Devel.hs | 5 ++++- yesod-bin/yesod-bin.cabal | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/yesod-bin/Devel.hs b/yesod-bin/Devel.hs index ecf78cb6..f8e78432 100644 --- a/yesod-bin/Devel.hs +++ b/yesod-bin/Devel.hs @@ -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 diff --git a/yesod-bin/yesod-bin.cabal b/yesod-bin/yesod-bin.cabal index fa6244f7..71603494 100644 --- a/yesod-bin/yesod-bin.cabal +++ b/yesod-bin/yesod-bin.cabal @@ -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