shell

package
v0.0.0-...-a8e4c5d Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, command string, opts ...RunOption) error

Run executes a shell command.

Types

type RunOption

type RunOption func(*interp.Runner)

func Env

func Env(vars map[string]string) RunOption

Env sets the environment variables for the command.

func Stderr

func Stderr(writer io.Writer) RunOption

Stderr sets the output location for the stderr of a command.

func Stdin

func Stdin(reader io.Reader) RunOption

Stdin pipes in the contents provided by the reader to the command.

func Stdout

func Stdout(writer io.Writer) RunOption

Stdout sets the output location for the stdout of a command.

type ShellRun

type ShellRun func(ctx context.Context, command string, options ...RunOption) error

Jump to

Keyboard shortcuts

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