From: Ian Lynagh Date: Sat, 18 Dec 2010 18:49:25 +0000 (+0000) Subject: Create ~/.ghc/ if it doesn't already exist; fixes trac #4522 X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=50769d7532f90b0ec1f1759a56d478cf2926a0ff Create ~/.ghc/ if it doesn't already exist; fixes trac #4522 --- diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs index a2ba64e..5a26324 100644 --- a/ghc/InteractiveUI.hs +++ b/ghc/InteractiveUI.hs @@ -369,14 +369,16 @@ interactiveUI srcs maybe_exprs = do withGhcAppData :: (FilePath -> IO a) -> IO a -> IO a withGhcAppData right left = do - either_dir <- IO.try (getAppUserDataDirectory "ghc") - case either_dir of - Right dir -> right dir - _ -> left + either_dir <- IO.try (getAppUserDataDirectory "ghc") + case either_dir of + Right dir -> + do createDirectoryIfMissing False dir `catchIO` \_ -> return () + right dir + _ -> left runGHCi :: [(FilePath, Maybe Phase)] -> Maybe [String] -> GHCi () runGHCi paths maybe_exprs = do - let + let read_dot_files = not opt_IgnoreDotGhci current_dir = return (Just ".ghci")