-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A DSL to describe common shell operations and interpeters for running them locally and remotely. -- @package handsy @version 0.0.7 module System.Handsy.Internal data HandsyF k Command :: FilePath -> [String] -> ByteString -> ((ExitCode, ByteString, ByteString) -> k) -> HandsyF k ReadFile :: FilePath -> (ByteString -> k) -> HandsyF k WriteFile :: FilePath -> ByteString -> (() -> k) -> HandsyF k AppendFile :: FilePath -> ByteString -> (() -> k) -> HandsyF k appendFile :: MonadFree HandsyF m_a6k2 => FilePath -> ByteString -> m_a6k2 () writeFile :: MonadFree HandsyF m_a6jX => FilePath -> ByteString -> m_a6jX () readFile :: MonadFree HandsyF m_a6jT => FilePath -> m_a6jT ByteString command :: MonadFree HandsyF m_a6jh => FilePath -> [String] -> ByteString -> m_a6jh (ExitCode, ByteString, ByteString) instance Functor HandsyF module System.Handsy type Handsy = FreeT HandsyF IO -- | Runs a command command :: FilePath -> [String] -> ByteString -> Handsy (ExitCode, ByteString, ByteString) -- | Reads a file and returns the contents of the file. readFile :: FilePath -> Handsy ByteString -- | writeFile file str function writes the bytestring -- str, to the file file. writeFile :: FilePath -> ByteString -> Handsy () -- | appendFile file str function appends the bytestring -- str, to the file file. appendFile :: FilePath -> ByteString -> Handsy () -- | Executes the given string in shell -- --
-- shell cmd stdin = command "/usr/bin/env" ["sh", "-c", cmd] stdin --shell :: String -> ByteString -> Handsy (ExitCode, ByteString, ByteString) -- | Same as shell, but ExitFailure is a runtime error. shell_ :: String -> ByteString -> Handsy (ByteString, ByteString) -- | Same as command, but ExitFailure is a runtime error. command_ :: FilePath -> [String] -> ByteString -> Handsy (ByteString, ByteString) -- | Executes the actions locally run :: Handsy a -> IO a module System.Handsy.Remote data RemoteOptions RemoteOptions :: (String, [String]) -> RemoteOptions sshCommand :: RemoteOptions -> (String, [String]) -- | Executes the actions at a remote host runRemote :: RemoteOptions -> Handsy a -> IO a -- | Copies a local file to remote host pushFile :: FilePath -> FilePath -> Handsy () -- | Fetches a file from remote host pullFile :: FilePath -> FilePath -> Handsy ()