diff options
Diffstat (limited to 'src/Command.hs')
-rw-r--r-- | src/Command.hs | 6 |
1 files changed, 5 insertions, 1 deletions
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) |