1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Create the semantic prefs dir if it doesn’t exist already.

Co-Authored-By: Ayman Nadeem <aymannadeem@gmail.com>
This commit is contained in:
Rob Rix 2018-08-03 13:41:48 -04:00
parent 2f038b92be
commit ef81ee2dbf

View File

@ -36,7 +36,7 @@ import Semantic.Telemetry
import Semantic.Telemetry.Log (LogOptions, Message(..), writeLogMessage)
import Semantic.Util
import System.Console.Haskeline
import System.Directory (getHomeDirectory)
import System.Directory (createDirectoryIfMissing, getHomeDirectory)
import System.FilePath
{-
@ -106,9 +106,11 @@ repl proxy parser paths = defaultConfig debugOptions >>= \ config -> runM . runD
modules <- topologicalSort <$> runImportGraphToModules proxy (snd <$> package)
homeDir <- liftIO getHomeDirectory
prefs <- liftIO (readPrefs (homeDir <> "/.haskeline"))
let settingsDir = homeDir <> "/.local/semantic"
liftIO $ createDirectoryIfMissing True settingsDir
let settings = Settings
{ complete = noCompletion
, historyFile = Just (homeDir <> "/.local/semantic/repl_history")
, historyFile = Just (settingsDir <> "/repl_history")
, autoAddHistory = True
}
runEvaluator