From d6c4daa2fb0b7f8dd0afb3ef50b2b85106bfd2ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Fri, 11 Apr 2025 20:25:15 +0200 Subject: Evaluate job and jobset in the Eval monad --- src/Command.hs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Command.hs') diff --git a/src/Command.hs b/src/Command.hs index 6fb7e90..6322818 100644 --- a/src/Command.hs +++ b/src/Command.hs @@ -11,7 +11,7 @@ module Command ( getCommonOptions, getRootPath, getJobRoot, getRepo, getDefaultRepo, tryGetDefaultRepo, - getEvalInput, + getEvalInput, cmdEvalWith, getTerminalOutput, getStorageDir, ) where @@ -139,6 +139,10 @@ getEvalInput = CommandExec $ do eiOtherRepos <- asks ciOtherRepos return EvalInput {..} +cmdEvalWith :: (EvalInput -> EvalInput) -> Eval a -> CommandExec a +cmdEvalWith f ev = do + either (tfail . textEvalError) return =<< liftIO .runEval ev . f =<< getEvalInput + getTerminalOutput :: CommandExec TerminalOutput getTerminalOutput = CommandExec (asks ciTerminalOutput) -- cgit v1.2.3