on master help sign in
Merge pull request #586 from david-christiansen/create-dir-startup

Create directory for storing history at startup

commit22ee5a4bca313851669bdc997cdc3ef0e2bcfa1d authorEdwin Brady <edwin.brady@gmail.com> dateSun 3 Nov 2013, 11:42 (13 years ago) parentc0cda7035a2e51
1 file changed+7
src/Idris/REPL.hs+7
src/Idris/REPL.hs+7
@@ -1131,6 +1131,13 @@ idrisMain opts =
11311131 Nothing -> return ()
11321132 Just expr -> execScript expr
11331133
1134+ -- Create Idris data dir + repl history and config dir
1135+ idrisCatch (do dir <- getIdrisUserDataDir
1136+ exists <- runIO $ doesDirectoryExist dir
1137+ unless exists $ iLOG ("Creating " ++ dir)
1138+ runIO $ createDirectoryIfMissing True (dir </> "repl"))
1139+ (\e -> return ())
1140+
11341141 historyFile <- fmap (</> "repl" </> "history") getIdrisUserDataDir
11351142
11361143 when runrepl $ initScript