Add version filter to the configuration
All checks were successful
Build / audit (push) Successful in 8s
Build / test (push) Successful in 15m9s

This commit is contained in:
2024-09-30 14:39:38 +02:00
parent 8168804d71
commit f395d57b33
3 changed files with 14 additions and 12 deletions

View File

@ -33,6 +33,7 @@ data PackageSettings = PackageSettings
{ name :: Text
, template :: Text
, is64 :: Bool
, version :: Text
, github :: Maybe (Text, Text)
, packagist :: Maybe (Text, Text)
, text :: Maybe (Text, [String])
@ -58,6 +59,7 @@ packageSettingsCodec = PackageSettings
<$> Toml.text "name" .= name
<*> Toml.text "template" .= template
<*> Toml.bool "is64" .= is64
<*> Toml.text "version" .= version
<*> Toml.dioptional (Toml.table githubCodec "github") .= github
<*> Toml.dioptional (Toml.table packagistCodec "packagist") .= packagist
<*> Toml.dioptional (Toml.table textCodec "text") .= text

View File

@ -190,7 +190,7 @@ latestPackagist PackageOwner{..} = do
fullName = Text.intercalate "/" [owner, name]
pure $ HashMap.lookup fullName packagistPackages
>>= fmap (version . fst) . Vector.uncons
>>= fmap (getField @"version" . fst) . Vector.uncons
-- * Remote text file