Mix configuration and PackageDescription
All checks were successful
Build / audit (push) Successful in 7s
Build / test (push) Successful in 14m41s

This commit is contained in:
2024-09-22 18:07:22 +02:00
parent 2a78256933
commit 00cc58f87e
2 changed files with 69 additions and 79 deletions

View File

@ -33,6 +33,9 @@ data PackageSettings = PackageSettings
{ name :: Text
, template :: Text
, is64 :: Bool
, github :: Maybe (Text, Text)
, packagist :: Maybe (Text, Text)
, text :: Maybe Text
} deriving (Eq, Show)
settingsCodec :: Toml.TomlCodec Settings
@ -54,3 +57,6 @@ packageSettingsCodec = PackageSettings
<$> Toml.text "name" .= name
<*> Toml.text "template" .= template
<*> Toml.bool "is64" .= is64
<*> Toml.dioptional (flip Toml.table "github" $ Toml.pair (Toml.text "owner") (Toml.text "name")) .= github
<*> Toml.dioptional (flip Toml.table "packagist" $ Toml.pair (Toml.text "owner") (Toml.text "name")) .= packagist
<*> Toml.dioptional (flip Toml.table "text" $ Toml.text "url") .= text