Documentation ¶
Index ¶
- Constants
- func CurrentEnvironment() []string
- func Execute(program string, args ...string) (stdout, stderr string, err error)
- func ExecuteAndLogToFile(filepath string, command string, args ...string)
- func ExecuteInDirectory(workingDirectory, program string, args ...string) (stdout, stderr string, err error)
- func ExecuteLive(squashErrors bool, program string, args ...string) (err error)
- func ExecuteLiveWithCallback(onStdout, onStderr func(...interface{}), printOutputOnError bool, ...) (err error)
- func ExecuteLiveWithCallbackAndChannels(onStdout, onStderr func(...interface{}), ...) (err error)
- func ExecuteLiveWithErr(stderrLines int, program string, args ...string) (err error)
- func ExecuteLiveWithErrAndCallbacks(stderrLines int, onStdout, onStderr func(...interface{}), program string, ...) (err error)
- func ExecuteWithStdin(input, program string, args ...string) (stdout, stderr string, err error)
- func MustExecuteLive(command string, args ...string)
- func PermanentlyStopAllChildProcesses(signal unix.Signal)
- func SetEnvironment(env []string)
Constants ¶
const ShellProgram = "/bin/bash"
ShellProgram is the default shell program used by the tooling.
Variables ¶
This section is empty.
Functions ¶
func CurrentEnvironment ¶
func CurrentEnvironment() []string
CurrentEnvironment returns the current environment variables that are being used for all processes launched from this package.
func ExecuteAndLogToFile ¶
ExecuteAndLogToFile runs a command in the shell and redirects stdout to the given file
func ExecuteInDirectory ¶
func ExecuteInDirectory(workingDirectory, program string, args ...string) (stdout, stderr string, err error)
Execute runs the provided command in a specific working directory.
func ExecuteLive ¶
ExecuteLive runs a command in the shell and logs it in real-time
func ExecuteLiveWithCallback ¶
func ExecuteLiveWithCallback(onStdout, onStderr func(...interface{}), printOutputOnError bool, program string, args ...string) (err error)
ExecuteLiveWithCallback runs a command in the shell and invokes the provided callbacks in real-time on each line of stdout and stderr. If printOutputOnError is true, the full output of the command will be printed after completion if the command returns an error. In the event the buffer becomes full the oldest buffered output is discarded.
func ExecuteLiveWithErr ¶
ExecuteLiveWithErr runs a command in the shell and logs it in real-time. In addition, if there is an error, the last x lines of stderr will be attached to the err object.
func ExecuteLiveWithErrAndCallbacks ¶
func ExecuteLiveWithErrAndCallbacks(stderrLines int, onStdout, onStderr func(...interface{}), program string, args ...string, ) (err error)
ExecuteLiveWithErr runs a command in the shell and logs it in real-time. In addition, if there is an error, the last x lines of stderr will be attached to the err object.
func ExecuteWithStdin ¶
ExecuteWithStdin - Run the command and use Stdin to pass input during execution
func MustExecuteLive ¶
MustExecuteLive executes the shell command. Panics on failure.
func PermanentlyStopAllChildProcesses ¶
PermanentlyStopAllChildProcesses will send the provided signal to all processes spawned by this package, and all of those process's children. Invoking this will also block future process creation, causing the Execute methods to return an error.
func SetEnvironment ¶
func SetEnvironment(env []string)
SetEnvironment sets the default environment variables to be used for all processes launched from this package.
Types ¶
This section is empty.