packages feed

handsy 0.0.6 → 0.0.7

raw patch · 3 files changed

+13/−7 lines, 3 filesdep +shell-escapePVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies added: shell-escape

API changes (from Hackage documentation)

- System.Handsy.Internal: appendFile :: MonadFree HandsyF m_a6fQ => FilePath -> ByteString -> m_a6fQ ()
+ System.Handsy.Internal: appendFile :: MonadFree HandsyF m_a6k2 => FilePath -> ByteString -> m_a6k2 ()
- System.Handsy.Internal: command :: MonadFree HandsyF m_a6f5 => FilePath -> [String] -> ByteString -> m_a6f5 (ExitCode, ByteString, ByteString)
+ System.Handsy.Internal: command :: MonadFree HandsyF m_a6jh => FilePath -> [String] -> ByteString -> m_a6jh (ExitCode, ByteString, ByteString)
- System.Handsy.Internal: readFile :: MonadFree HandsyF m_a6fH => FilePath -> m_a6fH ByteString
+ System.Handsy.Internal: readFile :: MonadFree HandsyF m_a6jT => FilePath -> m_a6jT ByteString
- System.Handsy.Internal: writeFile :: MonadFree HandsyF m_a6fL => FilePath -> ByteString -> m_a6fL ()
+ System.Handsy.Internal: writeFile :: MonadFree HandsyF m_a6jX => FilePath -> ByteString -> m_a6jX ()
- System.Handsy.Remote: RemoteOptions :: (FilePath, [String]) -> RemoteOptions
+ System.Handsy.Remote: RemoteOptions :: (String, [String]) -> RemoteOptions
- System.Handsy.Remote: sshCommand :: RemoteOptions -> (FilePath, [String])
+ System.Handsy.Remote: sshCommand :: RemoteOptions -> (String, [String])

Files

handsy.cabal view
@@ -1,5 +1,5 @@ name:          handsy-version:       0.0.6+version:       0.0.7 synopsis:      A DSL to describe common shell operations and interpeters for running them locally and remotely. -- description:    Homepage:      https://github.com/utdemir/handsy@@ -24,6 +24,8 @@                   , process                   , transformers                   , free-                  , process-extras +                  , process-extras+                  , shell-escape   hs-source-dirs:   src   default-language: Haskell2010+  ghc-options: -Wall
src/System/Handsy.hs view
@@ -3,12 +3,10 @@  module System.Handsy where -import           Control.Monad.IO.Class import qualified Data.ByteString.Lazy           as B import qualified Data.ByteString.Lazy.Char8     as C import           System.Exit -import           Control.Monad.Free.TH import           Control.Monad.Trans.Free import           System.Process.ByteString.Lazy 
src/System/Handsy/Remote.hs view
@@ -4,14 +4,18 @@ import           System.Handsy            as H import           System.Handsy.Internal   (HandsyF (..)) +import qualified Data.ByteString.Char8    as C8 import qualified Data.ByteString.Lazy     as B+import           System.Exit  import           Control.Monad.IO.Class import           Control.Monad.Trans.Free +import           Text.ShellEscape+ data RemoteOptions =   RemoteOptions {-    sshCommand :: (FilePath, [String])+    sshCommand :: (String, [String])   }  -- | Executes the actions at a remote host@@ -30,8 +34,10 @@       -> runSsh prg args stdin >>= runRemote opts . next    where-    (ssh, sshOpts) = sshCommand opts-    runSsh prg args stdin = run (command ssh (sshOpts ++ prg : args) stdin)+    runSsh :: String -> [String] -> B.ByteString -> IO (ExitCode, B.ByteString, B.ByteString)+    runSsh prg args stdin = let c = C8.unpack . C8.intercalate " " . map (bytes . bash . C8.pack) $ (prg:args)+                                (ssh, sshOpts) = sshCommand opts+                            in run $ command ssh (sshOpts ++ [c]) stdin  -- | Copies a local file to remote host pushFile :: FilePath -- ^ Local path of source