A peer-to-peer stack for code collaboration
Improve XDG files
Thomas Scholtes2b29023b8c68
diff --git a/exe/Repl/Main.hs b/exe/Repl/Main.hsindex f9881d8..053a6af 100644--- a/exe/Repl/Main.hs+++ b/exe/Repl/Main.hs@@ -9,11 +9,11 @@ main :: IO ()main = doopts' <- execParser allOptscfgFile <- case configFile opts' of- Nothing -> getConfig+ Nothing -> getConfigFileJust cfg -> pure cfgcfgSrc <- readFile cfgFilehist <- case histFile opts' of- Nothing -> getHistory+ Nothing -> getHistoryFileJust h -> pure hrepl (Just hist) (toS cfgFile) cfgSrc replBindingswherediff --git a/exe/Server/Client.hs b/exe/Server/Client.hsindex 74339eb..1ec5e7c 100644--- a/exe/Server/Client.hs+++ b/exe/Server/Client.hs@@ -15,11 +15,11 @@ main :: IO ()main = doopts' <- execParser allOptscfgFile <- case configFile opts' of- Nothing -> getConfig+ Nothing -> getConfigFileJust cfg -> pure cfgcfgSrc <- readFile cfgFilehist <- case histFile opts' of- Nothing -> getHistory+ Nothing -> getHistoryFileJust h -> pure hmgr <- newManager defaultManagerSettingslet cEnv = mkClientEnv mgr (serverURL opts')diff --git a/src/Radicle.hs b/src/Radicle.hsindex 2218227..59b7220 100644--- a/src/Radicle.hs+++ b/src/Radicle.hs@@ -82,8 +82,8 @@ module Radicle, ReplM-- * CLI- , getConfig- , getHistory+ , getConfigFile+ , getHistoryFile-- * Helpers, quotediff --git a/src/Radicle/Internal/CLI.hs b/src/Radicle/Internal/CLI.hsindex 4ec4a2b..f104242 100644--- a/src/Radicle/Internal/CLI.hs+++ b/src/Radicle/Internal/CLI.hs@@ -1,6 +1,6 @@module Radicle.Internal.CLI- ( getConfig- , getHistory+ ( getConfigFile+ , getHistoryFile)where@@ -8,9 +8,18 @@ import Protoludeimport System.Directory (XdgDirectory(..), getXdgDirectory)-- | Uses XDG_CONFIG_HOME if available.-getConfig :: IO FilePath-getConfig = getXdgDirectory XdgConfig "rad/config.rad"+-- | Location of the default radicle file to interpretradicle history.+-- Usually @~/.local/config/radicle/config.rad@.+--+-- See 'getXdgDirectory' XdgConfig' for how @~/.local/share@ is+-- determined.+getConfigFile :: IO FilePath+getConfigFile = getXdgDirectory XdgConfig "radicle/config.rad"--- | Uses XDG_CACHE_HOME if available.-getHistory :: IO FilePath-getHistory = getXdgDirectory XdgData "rad/config.rad"+-- | Location of the radicle history. Usually+-- @~/.local/share/radicle/history@.+--+-- See 'getXdgDirectory' 'XdgData' for how @~/.local/share@ is+-- determined.+getHistoryFile :: IO FilePath+getHistoryFile = getXdgDirectory XdgData "radicle/history"