Safe Haskell | None |
---|---|
Language | Haskell98 |
- cmdProperty :: String -> [String] -> Property NoInfo
- cmdProperty' :: String -> [String] -> (CreateProcess -> CreateProcess) -> Property NoInfo
- cmdPropertyEnv :: String -> [String] -> [(String, String)] -> Property NoInfo
- type Script = [String]
- scriptProperty :: Script -> Property NoInfo
- userScriptProperty :: User -> Script -> Property NoInfo
- data CommandParam
- boolSystem :: FilePath -> [CommandParam] -> IO Bool
- boolSystemEnv :: FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO Bool
- safeSystem :: FilePath -> [CommandParam] -> IO ExitCode
- safeSystemEnv :: FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO ExitCode
- shellEscape :: String -> String
- createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
Properties for running commands and scripts
cmdProperty :: String -> [String] -> Property NoInfo Source
A property that can be satisfied by running a command.
The command must exit 0 on success.
cmdProperty' :: String -> [String] -> (CreateProcess -> CreateProcess) -> Property NoInfo Source
cmdPropertyEnv :: String -> [String] -> [(String, String)] -> Property NoInfo Source
A property that can be satisfied by running a command, with added environment variables in addition to the standard environment.
scriptProperty :: Script -> Property NoInfo Source
A property that can be satisfied by running a script.
userScriptProperty :: User -> Script -> Property NoInfo Source
A property that can satisfied by running a script as user (cd'd to their home directory).
Lower-level interface for running commands
data CommandParam Source
Parameters that can be passed to a shell command.
boolSystem :: FilePath -> [CommandParam] -> IO Bool Source
Run a system command, and returns True or False if it succeeded or failed.
This and other command running functions in this module log the commands run at debug level, using System.Log.Logger.
boolSystemEnv :: FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO Bool Source
safeSystem :: FilePath -> [CommandParam] -> IO ExitCode Source
Runs a system command, returning the exit status.
safeSystemEnv :: FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO ExitCode Source
shellEscape :: String -> String Source
Escapes a filename or other parameter to be safely able to be exposed to the shell.
This method works for POSIX shells, as well as other shells like csh.
createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) Source
Wrapper around createProcess
from System.Process,
that does debug logging.