buildbox-1.0.0.1: Rehackable components for writing buildbots and test harnesses.

BuildBox.Command.System

Contents

Description

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...

Synopsis

Documentation

Wrappers

system :: String -> Build ExitCodeSource

Run a system command, returning its exit code.

ssystem :: String -> Build ()Source

Run a successful system command. If the exit code is ExitFailure then throw an error in the Build monad.

qsystem :: String -> Build ExitCodeSource

Quietly run a system command, returning its exit code.

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.

The real function

systemTeeIOSource

Arguments

:: Bool

Whether stdout and stderr should be forwarded to the parent process.

-> String

Command to run.

-> String

What to pass to the command's stdin.

-> IO (ExitCode, String, String) 

Run a system command, returning its ExitCode and what was written to stdout and stderr.