packages feed

shelly 1.6.0.1 → 1.6.1

raw patch · 2 files changed

+12/−3 lines, 2 files

Files

shelly.cabal view
@@ -1,6 +1,6 @@ Name:       shelly -Version:     1.6.0.1+Version:     1.6.1 Synopsis:    shell-like (systems) programming in Haskell  Description: Shelly provides convenient systems programming in Haskell,
src/Shelly.hs view
@@ -1062,10 +1062,19 @@ -- | the same as 'run', but return @()@ instead of the stdout content -- stdout will be read and discarded line-by-line run_ :: FilePath -> [Text] -> Sh ()-run_ = runFoldLines () (\_ _ -> ())+run_ exe args =+  -- same a runFoldLines except Inherit Stdout+  runHandles exe args [OutHandle Inherit] $ \inH _ errH -> do+    state <- get+    errVar <- liftIO $ do+      hClose inH -- setStdin was taken care of before the process even ran+      (putHandleIntoMVar mempty (|>) errH (sPutStderr state) (sPrintStderr state))+    errs <- liftIO $ lineSeqToText `fmap` wait errVar+    modify $ \state' -> state' { sStderr = errs }+    return ()  liftIO_ :: IO a -> Sh ()-liftIO_ action = void (liftIO action)+liftIO_ = void . liftIO  -- | Similar to 'run' but gives the raw stdout handle in a callback. -- If you want even more control, use 'runHandles'.