packages feed

shelly 1.6.1.1 → 1.6.1.2

raw patch · 2 files changed

+17/−10 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

shelly.cabal view
@@ -1,6 +1,6 @@ Name:       shelly -Version:     1.6.1.1+Version:     1.6.1.2 Synopsis:    shell-like (systems) programming in Haskell  Description: Shelly provides convenient systems programming in Haskell,
src/Shelly.hs view
@@ -1062,16 +1062,23 @@ -- | 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_ exe args =-  -- same a runFoldLines except Inherit Stdout-  runHandles exe args [OutHandle Inherit] $ \inH _ errH -> do+run_ exe args = 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 ()+    if sPrintStdout state+      then runWithColor_+      else runFoldLines () (\_ _ -> ()) exe args+  where+    -- same a runFoldLines except Inherit Stdout+    -- That allows color to show up+    runWithColor_ =+        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_ = void . liftIO