diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-01-09 19:39:52 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-01-10 20:17:54 +0100 |
commit | ded067166901805bba63a35b37fe83ebfc4e6aa8 (patch) | |
tree | 6ef85e05f4caa49662fabfa2a0b91cdf83e03fe6 /src/Main.hs | |
parent | 03c781c1a60759622e772ac7fb6a167111ed0bea (diff) |
Run jobs based on configuration in associated commit
Changelog: Run jobs based on configuration in associated commit
Diffstat (limited to 'src/Main.hs')
-rw-r--r-- | src/Main.hs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/Main.hs b/src/Main.hs index cdce0f9..971bffe 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -4,6 +4,7 @@ import Control.Monad import Control.Monad.Except import Control.Monad.Reader +import Data.ByteString.Lazy qualified as BL import Data.List import Data.Proxy import Data.Text qualified as T @@ -132,7 +133,11 @@ runSomeCommand (SC tproxy) args = do exitSuccess Just configPath <- findConfig - config <- parseConfig configPath - let cmd = commandInit tproxy (fcoSpecific opts) cmdargs - let CommandExec exec = commandExec cmd - flip runReaderT config exec + BL.readFile configPath >>= return . parseConfig >>= \case + Left err -> do + putStr err + exitFailure + Right config -> do + let cmd = commandInit tproxy (fcoSpecific opts) cmdargs + let CommandExec exec = commandExec cmd + flip runReaderT config exec |