summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-04-09 22:37:59 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2025-04-09 22:37:59 +0200
commit75f57ad0287c8aa1a217ec90cbc8533cc3b8d799 (patch)
tree70eea9c15fd16d1eb7142a152e01dd14dc44d132 /src
parent44b178831c8c6bd388c74bce5a9ccfae7e9c2287 (diff)
Run: default jobs without containing repo
Diffstat (limited to 'src')
-rw-r--r--src/Command/Run.hs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Command/Run.hs b/src/Command/Run.hs
index e117c57..61a4620 100644
--- a/src/Command/Run.hs
+++ b/src/Command/Run.hs
@@ -253,11 +253,18 @@ cmdRun (RunCommand RunOptions {..} args) = do
argumentJobs <- argumentJobSource jobOptions
- let rangeOptions'
- | null rangeOptions, null roNewCommitsOn, null roNewTags, null jobOptions = [ ( Nothing, "HEAD" ) ]
- | otherwise = rangeOptions
+ defaultSource <- getJobRoot >>= \case
+ _ | not (null rangeOptions && null roNewCommitsOn && null roNewTags && null jobOptions) -> do
+ emptyJobSource
- ranges <- forM rangeOptions' $ \( mbBase, paramTip ) -> do
+ JobRootRepo repo -> do
+ Just base <- findUpstreamRef repo "HEAD"
+ rangeSource base "HEAD"
+
+ JobRootConfig config -> do
+ argumentJobSource (jobName <$> configJobs config)
+
+ ranges <- forM rangeOptions $ \( mbBase, paramTip ) -> do
( base, tip ) <- case mbBase of
Just base -> return ( base, paramTip )
Nothing -> do
@@ -271,7 +278,7 @@ cmdRun (RunCommand RunOptions {..} args) = do
liftIO $ do
mngr <- newJobManager storageDir optJobs
- source <- mergeSources $ concat [ [ argumentJobs ], ranges, branches, tags ]
+ source <- mergeSources $ concat [ [ defaultSource, argumentJobs ], ranges, branches, tags ]
headerLine <- newLine tout ""
threadCount <- newTVarIO (0 :: Int)