shelly 1.4.2 → 1.4.3
raw patch · 2 files changed
+10/−4 lines, 2 filesdep +async
Dependencies added: async
Files
- shelly.cabal +2/−3
- src/Shelly.hs +8/−1
shelly.cabal view
@@ -1,6 +1,6 @@ Name: shelly -Version: 1.4.2+Version: 1.4.3 Synopsis: shell-like (systems) programming in Haskell Description: Shelly provides convenient systems programming in Haskell,@@ -41,13 +41,12 @@ containers >= 0.5.0.0, time >= 1.3 && < 1.5, directory >= 1.1.0.0 && < 1.3.0.0,- text, mtl >= 2, process >= 1.0, unix-compat < 0.5, system-filepath >= 0.4.7 && < 0.5, system-fileio < 0.4,- bytestring+ text, bytestring, async if impl(ghc >= 7.6.1) build-depends:
src/Shelly.hs view
@@ -23,7 +23,7 @@ module Shelly ( -- * Entering Sh.- Sh, ShIO, shelly, shellyNoDir, sub+ Sh, ShIO, shelly, shellyNoDir, asyncSh, sub , silently, verbosely, escaping, print_stdout, print_stderr, print_commands , tracing, errExit @@ -107,6 +107,7 @@ import Control.Applicative import Control.Exception hiding (handle) import Control.Concurrent+import Control.Concurrent.Async (async, Async) import Data.Time.Clock( getCurrentTime, diffUTCTime ) import qualified Data.Text.IO as TIO@@ -1244,3 +1245,9 @@ -- | threadDelay wrapper that uses seconds sleep :: Int -> Sh () sleep = liftIO . threadDelay . (1000 * 1000 *)++-- | spawn an asynchronous action with a copy of the current state+asyncSh :: Sh a -> Sh (Async a)+asyncSh proc = do+ state <- get+ liftIO $ async $ shelly (put state >> proc)