shh 0.2.0.4 → 0.2.0.5
raw patch · 5 files changed
+15/−7 lines, 5 filesPVP: minor bump suggested
API additions: PVP suggests at least a minor version bump
API changes (from Hackage documentation)
+ Shh: mkProc' :: Bool -> String -> [String] -> Proc ()
+ Shh.Internal: mkProc' :: Bool -> String -> [String] -> Proc ()
Files
- README.md +1/−1
- app/shh-app.hs +3/−3
- shh.cabal +1/−1
- src/Shh.hs +1/−0
- src/Shh/Internal.hs +9/−2
README.md view
@@ -1,7 +1,7 @@ # Shh [](http://hackage.haskell.org/package/shh)-[](http://hackage.haskell.org/package/shh-extras)+[](http://hackage.haskell.org/package/shh-extras) [](https://travis-ci.org/luke-clifton/shh) Shh is a library to enable convinient shell-like programming in Haskell.
app/shh-app.hs view
@@ -48,8 +48,8 @@ Just s -> pure s let- wrapped :: (Unit a, ExecArgs a) => a- wrapped = exe (shhDir <> "/wrapper")+ wrapper :: String+ wrapper = shhDir <> "/wrapper" debug $ "Shh home is: " <> shhDir@@ -66,5 +66,5 @@ emptyPermissions writeIfMissing "Shell.hs" defaultShell - wrapped "ghci" "-ghci-script" (shhDir <> "/init.ghci") (shhDir <> "/Shell.hs")+ runProc $ mkProc' True wrapper ["ghci", "-ghci-script", shhDir <> "/init.ghci", shhDir <> "/Shell.hs"]
shh.cabal view
@@ -1,5 +1,5 @@ name: shh-version: 0.2.0.4+version: 0.2.0.5 synopsis: Simple shell scripting from Haskell description: Provides a shell scripting environment for Haskell. It helps you all external binaries, and allows you to
src/Shh.hs view
@@ -6,6 +6,7 @@ -- created for you by using the `loadEnv` template Haskell function. , exe , mkProc+ , mkProc' , runProc , Proc() -- | == Piping and Redirection
src/Shh/Internal.hs view
@@ -219,14 +219,17 @@ runProc (Proc f) = f stdin stdout stderr (pure ()) (pure ()) -- | Create a `Proc` from a command and a list of arguments.-mkProc :: String -> [String] -> Proc ()-mkProc cmd args = Proc $ \i o e pl pw -> do+-- The boolean represents whether we should delegate control-c+-- or not. Most uses of @`mkProc'`@ in Shh do not delegate control-c.+mkProc' :: Bool -> String -> [String] -> Proc ()+mkProc' delegate cmd args = Proc $ \i o e pl pw -> do bracket (createProcess_ cmd (proc cmd args) { std_in = UseHandle i , std_out = UseHandle o , std_err = UseHandle e , close_fds = True+ , delegate_ctlc = delegate } ) (\(_,_,_,ph) -> terminateProcess ph)@@ -234,6 +237,10 @@ pl (waitProc cmd args ph `onException` terminateProcess ph) `finally` pw +-- | Create a `Proc` from a command and a list of arguments. Does not delegate+-- control-c handling.+mkProc :: String -> [String] -> Proc ()+mkProc = mkProc' False -- | Read the stdout of a `Proc`. This captures stdout, so further piping will -- not see anything on the input.