aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-12 07:24:12 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-12 07:24:12 +0100
commit7c12524d9935d564dc359eb4db01038406e45f38 (patch)
treec87d69823390d35835e5d60acf6682749b19018c
parentde1a0f087367393b35615693c71d1e26efea6fdd (diff)
chore: add `ExitCode` to `Outputable`
-rw-r--r--src/Process/Shell.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Process/Shell.hs b/src/Process/Shell.hs
index 904b70f..ffebad5 100644
--- a/src/Process/Shell.hs
+++ b/src/Process/Shell.hs
@@ -51,6 +51,9 @@ instance (MonadIO m, Outputable a) => Processable m a where
instance (MonadIO m, Outputable stdout, Outputable stderr) => Processable m (stdout, stderr) where
sh_ = ((\(Script stripNL s) -> fmap (\(out, err) -> (fromLBS (stripNL out), fromLBS (stripNL err))) (liftIO (readProcess_ (fromString s)))) =<<)
+instance (MonadIO m) => Processable m ExitCode where
+ sh_ = ((\(Script _ s) -> liftIO (runProcess (fromString s))) =<<)
+
instance (MonadIO m, Outputable stdout, Outputable stderr) => Processable m (ExitCode, stdout, stderr) where
sh_ = ((\(Script stripNL s) -> fmap (\(exitCode, out, err) -> (exitCode, fromLBS (stripNL out), fromLBS (stripNL err))) (liftIO (readProcess (fromString s)))) =<<)