From 50769d7532f90b0ec1f1759a56d478cf2926a0ff Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 18 Dec 2010 18:49:25 +0000 Subject: [PATCH] Create ~/.ghc/ if it doesn't already exist; fixes trac #4522 --- ghc/InteractiveUI.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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") -- 1.7.10.4