packages feed

shelly 0.13.1 → 0.13.2

raw patch · 2 files changed

+13/−14 lines, 2 files

Files

Shelly.hs view
@@ -28,10 +28,10 @@          Sh, ShIO, shelly, sub, silently, verbosely, escaping, print_stdout, print_commands, tracing           -- * Running external commands.-         , run, run_, cmd, (-|-), lastStderr, setStdin+         , run, run_, runFoldLines, cmd, (-|-), lastStderr, setStdin          , command, command_, command1, command1_          , sshPairs, sshPairs_- +          -- * Modifying and querying environment.          , setenv, get_env, get_env_text, getenv, getenv_def, appendToPath @@ -108,7 +108,7 @@ import Filesystem hiding (canonicalizePath) import qualified Filesystem.Path.CurrentOS as FP -import System.Directory ( setPermissions, getPermissions, Permissions(..), getTemporaryDirectory, findExecutable ) +import System.Directory ( setPermissions, getPermissions, Permissions(..), getTemporaryDirectory, findExecutable ) import Data.Char (isDigit)  {- GHC won't default to Text with this, even with extensions!@@ -238,7 +238,7 @@  put :: State -> Sh () put newState = do-  stateVar <- ask +  stateVar <- ask   liftIO (writeIORef stateVar newState)  -- FIXME: find the full path to the exe from PATH@@ -253,8 +253,8 @@   st <- get   shellyProcess st $     ShellCommand $ LT.unpack $ LT.intercalate " " (toTextIgnore exe : args)-     + shellyProcess :: State -> CmdSpec -> Sh (Handle, Handle, Handle, ProcessHandle) shellyProcess st cmdSpec =  do   (Just hin, Just hout, Just herr, pHandle) <- liftIO $@@ -337,7 +337,7 @@ chdir_p :: FilePath -> Sh a -> Sh a chdir_p d action = mkdir_p d >> chdir d action -  + -- | apply a String IO operations to a Text FilePath {- liftStringIO :: (String -> IO String) -> FilePath -> Sh FilePath@@ -671,7 +671,7 @@ -- -- "stdout" and "stderr" are collected. The "stdout" is returned as -- a result of "run", and complete stderr output is available after the fact using--- "lastStderr" +-- "lastStderr" -- -- All of the stdout output will be loaded into memory -- You can avoid this but still consume the result by using "run_",@@ -703,15 +703,16 @@ command1_ :: FilePath -> [Text] -> Text -> [Text] -> Sh () command1_ com args one_arg more_args = run_ com ([one_arg] ++ args ++ more_args) --- the same as "run", but return () instead of the stdout content+-- | 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 () (\(_, _) -> ())  liftIO_ :: IO a -> Sh () liftIO_ action = liftIO action >> return () --- same as "run", but fold over stdout as it is read to avoid keeping it in memory--- stderr is still placed in memory (this could be changed in the future)+-- | used by "run". fold over stdout line-by-line as it is read to avoid keeping it in memory+-- stderr is still being placed in memory under the assumption it is always relatively small runFoldLines :: a -> FoldCallback a -> FilePath -> [Text] -> Sh a runFoldLines start cb exe args = do     -- clear stdin before beginning command execution@@ -785,7 +786,7 @@         finalTo <- if not toIsDir then mkdir to >> return to else do                    let d = to </> dirname (addTrailingSlash from)-                   mkdir_p d >> return d +                   mkdir_p d >> return d         ls from >>= mapM_ (\item -> cp_r (from FP.</> filename item) (finalTo FP.</> filename item)) @@ -858,5 +859,3 @@   res <- what   t' <- liftIO getCurrentTime   return (realToFrac $ diffUTCTime t' t, res)--
shelly.cabal view
@@ -1,6 +1,6 @@ Name:       shelly -Version:     0.13.1+Version:     0.13.2 Synopsis:    shell-like (systems) programming in Haskell  Description: Shelly provides convenient systems programming in Haskell,