diff --git a/app/Options/Config.hs b/app/Options/Config.hs index bbe5ab2..f6b2b11 100644 --- a/app/Options/Config.hs +++ b/app/Options/Config.hs @@ -8,8 +8,9 @@ where import Control.Monad (void) import Data.Aeson qualified as Aeson -import Data.Functor.Barbie -import Options.Types +import Data.Functor.Barbie (bpure) +import Data.Yaml qualified as Yaml +import Options.Types (ClientSessionF) import System.Directory (createDirectoryIfMissing, doesFileExist) import System.Environment.XDG.BaseDir (getUserConfigDir) import System.FilePath @@ -23,7 +24,7 @@ readJSON = do void $ createDirectoryIfMissing True configDir let path = configDir "config" doesFileExist path >>= \case - True -> Aeson.decodeFileStrict path + True -> Yaml.decodeFileThrow path False -> pure Nothing fromConfig :: IO (ClientSessionF Maybe) diff --git a/cofree-bot.cabal b/cofree-bot.cabal index ace0ca4..40c1c97 100644 --- a/cofree-bot.cabal +++ b/cofree-bot.cabal @@ -73,6 +73,7 @@ executable cofree-bot , mtl , optparse-applicative , xdg-basedir + , yaml other-modules: , Options