Copyright | © 2015-2017 Stack Builders |
---|---|
License | MIT |
Maintainer | Justin Leitgeb <justin@stackbuilders.com> |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
Collection of type safe shell commands that can be fed into
runCommand
.
- class Command a where
- data Whoami = Whoami
- data Cd cmd = Cd (Path Abs Dir) cmd
- data MkDir = MkDir (Path Abs Dir)
- data Rm where
- data Mv t = Mv (Path Abs t) (Path Abs t)
- data Ln where
- data Ls = Ls (Path Abs Dir)
- data Readlink t = Readlink (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 Command a where Source #
Class for data types that represent shell commands in typed way.
renderCommand :: a -> String Source #
How to render the command before feeding it into shell (possibly via SSH).
parseResult :: Proxy a -> String -> Result a Source #
How to parse the result from stdout.
Command GenericCommand Source # | |
Command GitReset Source # | |
Command GitFetch Source # | |
Command GitClone Source # | |
Command GitCheckout Source # | |
Command Touch Source # | |
Command Ls Source # | |
Command Ln Source # | |
Command Rm Source # | |
Command MkDir Source # | |
Command Whoami Source # | |
Command (Find File) Source # | |
Command (Find Dir) Source # | |
Command (Readlink File) Source # | |
Command (Readlink Dir) Source # | |
Command (Mv File) Source # | |
Command (Mv Dir) Source # | |
Command cmd => Command (Cd cmd) Source # | |
Unix 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.
Find (a very limited version).
data GitCheckout Source #
Git checkout.
Git clone.
Git fetch (simplified).
Git reset.
data GenericCommand Source #
Weakly-typed generic command, avoid using it directly.
mkGenericCommand :: String -> Maybe GenericCommand Source #
Smart constructor that allows to create GenericCommand
s. Just a
little bit more safety.
unGenericCommand :: GenericCommand -> String Source #
Get the raw command back from GenericCommand
.
readScript :: MonadIO m => Path Abs File -> m [GenericCommand] Source #
Read commands from a file.