Documentation
¶
Overview ¶
Package host provides facilities for interfacing with the host operating system, logging activities performed.
Index ¶
- func CombinedOutput(name string, arg ...string) (combinedOutput string, err error)
- func Output(name string, arg ...string) (string, error)
- func Run(name string, arg ...string) (err error)
- func RunBatch(allowFail bool, commands ...[]string) (err error)
- func RunIgnoreError(errString string, command string, args ...string) (found bool, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombinedOutput ¶
CombinedOutput is equivalent to exec.Command(name, arg...).CombinedOutput() but with logging.
func Output ¶
Output is like CombinedOutput but only returns Standard Out output. If an error is encountered, both standard error and standard output are logged.
func RunBatch ¶
RunBatch calls Run for each command in commands, in sequence. If allowFail is false it will return if an error is returned from Run. All errors are logged regardless of allowFail. The returned error is the result of the last Run call.
func RunIgnoreError ¶
RunIgnoreError calls CombinedOutput(comand, args...). If errString is found in the command output, found is true and err is nil. Otherwise found is false, and err is the error returned from CombinedOutput (possibly nil).
Types ¶
This section is empty.