| Copyright | © 2015-2017 Stack Builders |
|---|---|
| License | MIT |
| Maintainer | Justin Leitgeb <justin@stackbuilders.com> |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
System.Hapistrano.Commands
Description
Collection of type safe shell commands that can be fed into
runCommand.
Synopsis
- class Command a where
- type Result a :: *
- renderCommand :: a -> String
- parseResult :: Proxy a -> String -> Result a
- data Whoami = Whoami
- data Cd cmd = Cd (Path Abs Dir) cmd
- data MkDir = MkDir (Path Abs Dir)
- data Rm where
- data Mv t = Mv TargetSystem (Path Abs t) (Path Abs t)
- data Ln where
- data Ls = Ls (Path Abs Dir)
- data Readlink t = Readlink TargetSystem (Path Abs File)
- data Find t = Find Natural (Path Abs Dir)
- data Touch = Touch (Path Abs File)
- data GitCheckout = GitCheckout String
- data GitClone = GitClone Bool (Either String (Path Abs Dir)) (Path Abs Dir)
- data GitFetch = GitFetch String
- data GitReset = GitReset String
- data GenericCommand
- mkGenericCommand :: String -> Maybe GenericCommand
- unGenericCommand :: GenericCommand -> String
- readScript :: MonadIO m => Path Abs File -> m [GenericCommand]
Documentation
Class for data types that represent shell commands in typed way.
Methods
renderCommand :: a -> String #
How to render the command before feeding it into shell (possibly via SSH).
parseResult :: Proxy a -> String -> Result a #
How to parse the result from stdout.
Instances
| Command GenericCommand # | |
Defined in System.Hapistrano.Commands Associated Types type Result GenericCommand :: Type # Methods renderCommand :: GenericCommand -> String # parseResult :: Proxy GenericCommand -> String -> Result GenericCommand # | |
| Command GitReset # | |
| Command GitFetch # | |
| Command GitClone # | |
| Command GitCheckout # | |
Defined in System.Hapistrano.Commands Associated Types type Result GitCheckout :: Type # Methods renderCommand :: GitCheckout -> String # parseResult :: Proxy GitCheckout -> String -> Result GitCheckout # | |
| Command Touch # | |
| Command Ls # | |
| Command Ln # | |
| Command Rm # | |
| Command MkDir # | |
| Command Whoami # | |
| Command (Find File) # | |
| Command (Find Dir) # | |
| Command (Readlink File) # | |
| Command (Readlink Dir) # | |
| Command (Mv File) # | |
| Command (Mv Dir) # | |
| Command cmd => Command (Cd cmd) # | |
Unix whoami.
Constructors
| Whoami |
Specify directory in which to perform another command.
Create a directory. Does not fail if the directory already exists.
Delete file or directory.
Move or rename files or directories.
Create symlinks.
ls, so far used only to check existence of directories, so it's not
very functional right now.
Read link.
Constructors
| Readlink TargetSystem (Path Abs File) |
Find (a very limited version).
touch.
data GitCheckout #
Git checkout.
Constructors
| GitCheckout String |
Instances
| Command GitCheckout # | |
Defined in System.Hapistrano.Commands Associated Types type Result GitCheckout :: Type # Methods renderCommand :: GitCheckout -> String # parseResult :: Proxy GitCheckout -> String -> Result GitCheckout # | |
| type Result GitCheckout # | |
Defined in System.Hapistrano.Commands | |
Git fetch (simplified).
data GenericCommand #
Weakly-typed generic command, avoid using it directly.
Instances
mkGenericCommand :: String -> Maybe GenericCommand #
Smart constructor that allows to create GenericCommands. Just a
little bit more safety.
unGenericCommand :: GenericCommand -> String #
Get the raw command back from GenericCommand.
readScript :: MonadIO m => Path Abs File -> m [GenericCommand] #
Read commands from a file.