run

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Cancel

func Cancel()

Cancel invokes a cancel call on all active commands

func Command

func Command(cmd string, opts ...Option) string

Command a command: wait until completion, return stdout and discard Stderr unless an error occurs, in which case the entire contents of stdout and stderr are returned as part of the error text. This function DOES NOT shell-split the command text provided.

func TeeWriter

func TeeWriter(w1, w2 io.Writer) interface {
	io.Writer
	Reset(w1, w2 io.Writer)
}

Types

type Option

type Option func(context.Context, *exec.Cmd) error

Option is used to alter the command used in Exec calls

func Args

func Args(args ...string) Option

Args appends args to the command

func Env

func Env(key, val string) Option

Env adds an environment variable to the command

func Quiet

func Quiet() Option

Quiet logs at Debug level instead of Log level

func Stderr

func Stderr(w io.Writer) Option

Stderr executes with stdout output mapped to the current process' stdout and optionally stderr

func Stdin

func Stdin(in io.Reader) Option

Stdin executes with stdout output mapped to the current process' stdout and optionally stderr

func Stdout

func Stdout(w io.Writer) Option

Stdout executes with stdout output mapped to the current process' stdout and optionally stderr

func Write

func Write(path string) Option

Write outputs stdout to a file

Jump to

Keyboard shortcuts

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