From f449ef32e31e10b9412e932f0181ccfa4314e728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Sat, 8 Nov 2025 22:24:27 +0100 Subject: Allow repo declaration without giving path --- src/Config.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/Config.hs') 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) -- cgit v1.2.3