Versions in this module Expand all Collapse all v5 v5.1.0 Nov 12, 2024 Changes in this version type Result + Success bool v5.0.0 Jul 15, 2024 Changes in this version + var DefaultLogFn PrintfFn + var DefaultLogPrefix = "exec: " + var DefaultStderrColorFn = color.New(color.FgRed).SprintFunc() + type Cmd struct + func Command(name string, arg ...string) *Cmd + func (c *Cmd) Directory(dir string) *Cmd + func (c *Cmd) Env(env []string) *Cmd + func (c *Cmd) ExpectSuccess() *Cmd + func (c *Cmd) LogFn(fn PrintfFn) *Cmd + func (c *Cmd) LogPrefix(prefix string) *Cmd + func (c *Cmd) Run(ctx context.Context) (*Result, error) + func (c *Cmd) RunCombinedOut(ctx context.Context) (*ResultOut, error) + func (c *Cmd) Stderr(w io.Writer) *Cmd + func (c *Cmd) Stdout(w io.Writer) *Cmd + type ExitCodeError struct + func (e *ExitCodeError) ColoredError(highlightFn SprintFn, errorFn SprintFn, withCmdOutput bool) string + func (e *ExitCodeError) Error() string + type PrintfFn func(format string, a ...any) + type Result struct + Command string + Dir string + ExitCode int + func (r *Result) ExpectSuccess() error + type ResultOut struct + CombinedOutput []byte + func (r *ResultOut) StrOutput() string + type SprintFn func(...any) string Other modules containing this package github.com/simplesurance/baur/v2 github.com/simplesurance/baur/v3 github.com/simplesurance/baur/v4