summaryrefslogtreecommitdiff
path: root/ghc/InteractiveUI.hs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2010-12-18 18:49:25 +0000
committerIan Lynagh <igloo@earth.li>2010-12-18 18:49:25 +0000
commit50769d7532f90b0ec1f1759a56d478cf2926a0ff (patch)
tree9cc5931d54f7a2dc2daa8574bad3ea42b29dc88e /ghc/InteractiveUI.hs
parent14f9af49db1672e023ac8d8c506b42bc5400a787 (diff)
downloadhaskell-50769d7532f90b0ec1f1759a56d478cf2926a0ff.tar.gz
Create ~/.ghc/ if it doesn't already exist; fixes trac #4522
Diffstat (limited to 'ghc/InteractiveUI.hs')
-rw-r--r--ghc/InteractiveUI.hs12
1 files changed, 7 insertions, 5 deletions
diff --git a/ghc/InteractiveUI.hs b/ghc/InteractiveUI.hs
index a2ba64ef07..5a26324bb1 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")