summaryrefslogtreecommitdiff
path: root/src/Config.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-03-12 21:34:16 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2025-03-12 21:34:16 +0100
commitf8b2df887d3847041a81b00dbea70db30b07eb92 (patch)
tree7eb2263b95d19e4379126af94c98465e7bf23ee7 /src/Config.hs
parent387d63dfbc9cf5b71819461fac2397b57caeb3e4 (diff)
Run jobs even without default repo
Diffstat (limited to 'src/Config.hs')
-rw-r--r--src/Config.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Config.hs b/src/Config.hs
index da8a089..e9287e4 100644
--- a/src/Config.hs
+++ b/src/Config.hs
@@ -9,6 +9,7 @@ module Config (
import Control.Monad
import Control.Monad.Combinators
+import Control.Monad.IO.Class
import Data.ByteString.Lazy qualified as BS
import Data.List
@@ -149,16 +150,16 @@ parseConfig contents = do
Left $ prettyPosWithSource pos contents err
Right conf -> Right conf
-loadConfigForCommit :: Commit -> IO (Either String Config)
+loadConfigForCommit :: MonadIO m => Commit -> m (Either String Config)
loadConfigForCommit commit = do
readCommittedFile commit configFileName >>= return . \case
Just content -> either (\_ -> Left $ "failed to parse " <> configFileName) Right $ parseConfig content
Nothing -> Left $ configFileName <> " not found"
-loadJobSetForCommit :: Commit -> IO JobSet
+loadJobSetForCommit :: MonadIO m => Commit -> m JobSet
loadJobSetForCommit commit = toJobSet <$> loadConfigForCommit commit
where
toJobSet configEither = JobSet
- { jobsetCommit = commit
+ { jobsetCommit = Just commit
, jobsetJobsEither = fmap configJobs configEither
}