use XDG functions from the directory pakage
This commit is contained in:
parent
5108b035a4
commit
101f5c06af
@ -32,10 +32,10 @@ executable breve
|
|||||||
other-extensions: OverloadedStrings
|
other-extensions: OverloadedStrings
|
||||||
build-depends: base >=4.8 && <5.0,
|
build-depends: base >=4.8 && <5.0,
|
||||||
warp, warp-tls, tls, blaze-html, blaze-markup,
|
warp, warp-tls, tls, blaze-html, blaze-markup,
|
||||||
servant-server, servant, servant-blaze, http-api-data,
|
servant-server, servant, servant-blaze,
|
||||||
wai, wai-extra, streaming-commons,
|
wai, wai-extra, streaming-commons, http-api-data,
|
||||||
transformers, mtl,
|
transformers, mtl,
|
||||||
text, aeson, bytestring, binary,
|
text, aeson, bytestring, binary,
|
||||||
hashtables, cryptohash, random,
|
hashtables, cryptohash, random,
|
||||||
xdg-basedir, configurator, directory
|
configurator, directory
|
||||||
ghc-options: -threaded -O2
|
ghc-options: -threaded -O2
|
||||||
|
@ -41,9 +41,9 @@ settings :: Maybe FilePath -> IO AppSettings
|
|||||||
settings path = do
|
settings path = do
|
||||||
configPath <- case path of
|
configPath <- case path of
|
||||||
Just path -> return path
|
Just path -> return path
|
||||||
Nothing -> getUserConfigFile "breve" ""
|
Nothing -> getXdgDirectory XdgConfig "breve"
|
||||||
|
|
||||||
urlsPath <- getUserDataFile "breve" ""
|
urlsPath <- getXdgDirectory XdgData "breve"
|
||||||
|
|
||||||
config <- load [Required configPath]
|
config <- load [Required configPath]
|
||||||
host <- lookupDefault "localhost" config "hostname"
|
host <- lookupDefault "localhost" config "hostname"
|
||||||
|
Loading…
Reference in New Issue
Block a user