From 7c12524d9935d564dc359eb4db01038406e45f38 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 12 Mar 2024 07:24:12 +0100 Subject: chore: add `ExitCode` to `Outputable` --- src/Process/Shell.hs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Process') 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)))) =<<) -- cgit v1.2.3