diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2025-11-08 22:24:27 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-11-08 22:24:27 +0100 |
| commit | f449ef32e31e10b9412e932f0181ccfa4314e728 (patch) | |
| tree | 3322d63a909615cb18874796bb0adcb93b21d66d /src/Config.hs | |
| parent | d8354b8f1b2bbb6d911070ca9822c7e4fbd88bca (diff) | |
Allow repo declaration without giving path
Diffstat (limited to 'src/Config.hs')
| -rw-r--r-- | src/Config.hs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Config.hs b/src/Config.hs index 8a7649a..1b0e046 100644 --- a/src/Config.hs +++ b/src/Config.hs @@ -138,9 +138,12 @@ parseUses = withSeq "Uses list" $ mapM $ parseRepo :: Text -> Node Pos -> Parser DeclaredRepo -parseRepo name node = flip (withMap "Repo") node $ \r -> DeclaredRepo - <$> pure (RepoName name) - <*> (T.unpack <$> r .: "path") +parseRepo name node = choice + [ flip (withNull "Repo") node $ return $ DeclaredRepo (RepoName name) Nothing + , flip (withMap "Repo") node $ \r -> DeclaredRepo + <$> pure (RepoName name) + <*> (fmap T.unpack <$> r .:? "path") + ] findConfig :: IO (Maybe FilePath) |