run

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Stdout   string
	Stderr   string
	ExitCode int
	Err      error
}

Result holds the output and exit status of a command execution.

func Cmd

func Cmd(ctx context.Context, name string, args ...string) Result

Cmd executes a command with the given context and returns stdout, stderr, and exit code. The command is logged at debug level before execution.

func CmdInDir

func CmdInDir(ctx context.Context, dir, name string, args ...string) Result

CmdInDir executes a command in the specified directory.

func (Result) MustSucceed

func (r Result) MustSucceed(cmdDesc string) error

MustSucceed wraps a Result and returns an error if the command failed.

func (Result) Success

func (r Result) Success() bool

Success returns true if the command executed successfully (exit code 0).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL