slackbuilder/app/SlackBuilder/Config.hs

25 lines
606 B
Haskell
Raw Normal View History

2023-08-09 20:59:42 +02:00
module SlackBuilder.Config
( Settings(..)
, settingsCodec
) where
import Data.Text (Text)
import Toml ((.=))
import qualified Toml
2023-08-15 10:33:19 +02:00
data Settings = Settings
{ ghToken :: !Text
, repository :: !FilePath
, branch :: Text
, downloadURL :: Text
, remotePath :: Text
2023-08-09 20:59:42 +02:00
} deriving (Eq, Show)
settingsCodec :: Toml.TomlCodec Settings
settingsCodec = Settings
<$> Toml.text "gh_token" .= ghToken
2023-08-15 10:33:19 +02:00
<*> Toml.string "repository" .= repository
<*> Toml.text "branch" .= branch
<*> Toml.text "download_url" .= downloadURL
<*> Toml.text "remote_path" .= remotePath