Running system commands. On some platforms this may cause the command to be executed directly, so
shell tricks won't work. The Build
monad can be made to log commands executed with all versions
of system
by setting buildConfigLogSystem
in the BuildConfig
passed to runBuildPrintWithConfig
.
We define a lot of wrappers because executing system commands is the bread-and-butter of buildbots, and we usually need all the versions...
- module System.Exit
- system :: String -> Build ExitCode
- ssystem :: String -> Build ()
- qsystem :: String -> Build ExitCode
- qssystem :: String -> Build ()
- ssystemOut :: String -> Build String
- qssystemOut :: String -> Build String
- systemTee :: Bool -> String -> String -> Build (ExitCode, String, String)
- ssystemTee :: Bool -> String -> String -> Build ()
- systemTeeIO :: Bool -> String -> String -> IO (ExitCode, String, String)
Documentation
module System.Exit
Wrappers
ssystem :: String -> Build ()Source
Run a successful system command.
If the exit code is ExitFailure
then throw an error in the Build
monad.
qssystem :: String -> Build ()Source
Quietly run a successful system command.
If the exit code is ExitFailure
then throw an error in the Build
monad.
ssystemOut :: String -> Build StringSource
Run a successful system command, returning what it wrote to its stdout
.
If anything was written to stderr
then treat that as failure.
If it fails due to writing to stderr
or returning ExitFailure
then throw an error in the Build
monad.
qssystemOut :: String -> Build StringSource
Quietly run a successful system command, returning what it wrote to its stdout
.
If anything was written to stderr
then treat that as failure.
If it fails due to writing to stderr
or returning ExitFailure
then throw an error in the Build
monad.
systemTee :: Bool -> String -> String -> Build (ExitCode, String, String)Source
Like systemTeeIO
, but in the Build
monad.
ssystemTee :: Bool -> String -> String -> Build ()Source
Like systemTeeIO
, but in the Build
monad and throw an error if it returns ExitFailure
.