| Copyright | (c) Julian Ospald 2020 |
|---|---|
| License | LGPL-3.0 |
| Maintainer | hasufell@hasufell.de |
| Stability | experimental |
| Portability | portable |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GHCup.Prelude.Process
Description
Synopsis
- executeOut :: MonadIO m => FilePath -> [String] -> Maybe FilePath -> m CapturedProcess
- executeOut' :: MonadIO m => FilePath -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> m CapturedProcess
- execLogged :: (MonadReader env m, HasSettings env, HasLog env, HasDirs env, MonadIO m, MonadThrow m) => FilePath -> [String] -> Maybe FilePath -> FilePath -> Maybe [(String, String)] -> m (Either ProcessError ())
- exec :: MonadIO m => String -> [String] -> Maybe FilePath -> Maybe [(String, String)] -> m (Either ProcessError ())
- toProcessError :: FilePath -> [String] -> Maybe ProcessStatus -> Either ProcessError ()
Documentation
Arguments
| :: MonadIO m | |
| => FilePath | command as filename, e.g. |
| -> [String] | arguments to the command |
| -> Maybe FilePath | chdir to this path |
| -> m CapturedProcess |
Execute the given command and collect the stdout, stderr and the exit code. The command is run in a subprocess.
Arguments
| :: (MonadReader env m, HasSettings env, HasLog env, HasDirs env, MonadIO m, MonadThrow m) | |
| => FilePath | thing to execute |
| -> [String] | args for the thing |
| -> Maybe FilePath | optionally chdir into this |
| -> FilePath | log filename (opened in append mode) |
| -> Maybe [(String, String)] | optional environment |
| -> m (Either ProcessError ()) |
Arguments
| :: MonadIO m | |
| => String | thing to execute |
| -> [String] | args for the thing |
| -> Maybe FilePath | optionally chdir into this |
| -> Maybe [(String, String)] | optional environment |
| -> m (Either ProcessError ()) |
Thin wrapper around executeFile.
toProcessError :: FilePath -> [String] -> Maybe ProcessStatus -> Either ProcessError () Source #