module XDG
( getStateDir
, getConfigDir
, getConfigFile
, getRepoDir
) where
import System.Directory (getXdgDirectory, XdgDirectory(..))
import System.FilePath ((</>))
import Types (appName)
getStateDir :: IO FilePath
getStateDir :: IO FilePath
getStateDir = XdgDirectory -> FilePath -> IO FilePath
getXdgDirectory XdgDirectory
XdgState FilePath
appName
getConfigDir :: IO FilePath
getConfigDir :: IO FilePath
getConfigDir = XdgDirectory -> FilePath -> IO FilePath
getXdgDirectory XdgDirectory
XdgConfig FilePath
appName
getConfigFile :: IO FilePath
getConfigFile :: IO FilePath
getConfigFile = do
dir <- IO FilePath
getConfigDir
return $ dir </> "config.yaml"
getRepoDir :: IO FilePath
getRepoDir :: IO FilePath
getRepoDir = do
stateDir <- IO FilePath
getStateDir
return $ stateDir </> "stackage-snapshots"