execext

package
v3.44.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNilOptions = errors.New("execext: nil options given")

ErrNilOptions is returned when a nil options is given

Functions

func ExpandFields added in v3.43.0

func ExpandFields(s string) ([]string, error)

ExpandFields is a wrapper around expand.Fields. It will escape the input string, expand any shell symbols (such as '~') and resolve any environment variables. It also expands brace expressions ({a.b}) and globs (*/**) and returns the results as a list of strings.

func ExpandLiteral added in v3.43.0

func ExpandLiteral(s string) (string, error)

ExpandLiteral is a wrapper around expand.Literal. It will escape the input string, expand any shell symbols (such as '~') and resolve any environment variables.

func RunCommand

func RunCommand(ctx context.Context, opts *RunCommandOptions) error

RunCommand runs a shell command

Types

type RunCommandOptions

type RunCommandOptions struct {
	Command   string
	Dir       string
	Env       []string
	PosixOpts []string
	BashOpts  []string
	Stdin     io.Reader
	Stdout    io.Writer
	Stderr    io.Writer
}

RunCommandOptions is the options for the RunCommand func.

Jump to

Keyboard shortcuts

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