diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-04-09 22:11:18 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-04-09 22:11:18 +0200 |
commit | 44b178831c8c6bd388c74bce5a9ccfae7e9c2287 (patch) | |
tree | 5de957860bc166e5d8e9d291b212a967d616c169 /src/Command | |
parent | 6645caa6796c1f253aded5c483e9f4d504f5fba5 (diff) |
Check that range argument parts are not empty
Diffstat (limited to 'src/Command')
-rw-r--r-- | src/Command/Run.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Command/Run.hs b/src/Command/Run.hs index 068f3a2..e117c57 100644 --- a/src/Command/Run.hs +++ b/src/Command/Run.hs @@ -238,11 +238,15 @@ cmdRun (RunCommand RunOptions {..} args) = do ( rangeOptions, jobOptions ) <- partitionEithers . concat <$> sequence [ forM roRanges $ \range -> case T.splitOn ".." range of - [ base, tip ] -> return $ Left ( Just base, tip ) + [ base, tip ] + | not (T.null base) && not (T.null tip) + -> return $ Left ( Just base, tip ) _ -> tfail $ "invalid range: " <> range , forM roSinceUpstream $ return . Left . ( Nothing, ) , forM args $ \arg -> case T.splitOn ".." arg of - [ base, tip ] -> return $ Left ( Just base, tip ) + [ base, tip ] + | not (T.null base) && not (T.null tip) + -> return $ Left ( Just base, tip ) [ _ ] -> return $ Right $ JobName arg _ -> tfail $ "invalid argument: " <> arg ] |