on master help sign in
Create directory for storing history at startup
commit35a2e51a311cfcec7d0d563d2a6947ae4f5fe03e authorDavid Christiansen <david@davidchristiansen.dk> dateSun 3 Nov 2013, 14:39 (13 years ago) parentfe3354b
1 file changed+7
src/Idris/REPL.hs+7
src/Idris/REPL.hs+7
@@ -1130,6 +1130,13 @@ idrisMain opts =
11301130 Nothing -> return ()
11311131 Just expr -> execScript expr
11321132
1133+ -- Create Idris data dir + repl history and config dir
1134+ idrisCatch (do dir <- getIdrisUserDataDir
1135+ exists <- runIO $ doesDirectoryExist dir
1136+ unless exists $ iLOG ("Creating " ++ dir)
1137+ runIO $ createDirectoryIfMissing True (dir </> "repl"))
1138+ (\e -> return ())
1139+
11331140 historyFile <- fmap (</> "repl" </> "history") getIdrisUserDataDir
11341141
11351142 when runrepl $ initScript