Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StderrNotEmpty ¶ added in v0.4.0
StderrNotEmpty checks if the stderr is truly not empty
Types ¶
type Execer ¶
type Execer interface {
// Run executes a command with the repository's folder as working dir
Run(ctx context.Context, command string, args ...string) (Result, error)
// RunX executes a command with repository's folder as working dir. It will return an error
// if exit code is non zero.
RunX(ctx context.Context, command string, args ...string) (string, error)
// Run executes a command with the repository's folder as working dir accepting a stdin
RunWithStdin(ctx context.Context, stdin io.Reader, command string, args ...string) (Result, error)
// RunWithStdin executes a command with the repository's folder as working dir accepting a stdin and returning the stdout
RunWithStdinX(ctx context.Context, stdin io.Reader, command string, args ...string) (string, error)
// Log logs a message with the given level and fields
Log(ctx context.Context, level slog.Level, msg string, fields ...any)
// DebugShell starts a shell session in the execer's directory
DebugShell(ctx context.Context)
// WithEnv creates a child execer with added env variables
WithEnv(kv ...string) Execer
// WithLogFields creates a child execer with added log fields
WithLogFields(kvFields ...any) Execer
// Sub creates a new execer in an existing subpath.
Sub(subpath string) (Execer, error)
// GenerateFS returns a FS object relative to the exec dir to interact with
GenerateFS() afero.Fs
}
Execer defines an interface to execute commands in a given directory with optional environment variables and logging capabilities.
Click to show internal directories.
Click to hide internal directories.