Documentation
¶
Overview ¶
Package shell is the argv-only exec wrapper. Every argument is passed as a distinct argv element. No shell string is ever composed. If a downstream
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyBinary = errors.New("shell: bin is empty")
ErrEmptyBinary is returned when Exec or Capture is called with "".
Functions ¶
func PathResolver ¶
PathResolver is the default resolver. Looks the binary up on $PATH.
Types ¶
type Resolver ¶
Resolver turns a binary name into an executable path. Pluggable so tests can avoid touching the real $PATH.
type Runner ¶
type Runner struct {
Stdout io.Writer
Stderr io.Writer
Stdin io.Reader
// Resolve locates a binary. Defaults to PathResolver when nil.
Resolve Resolver
// Env, when non-nil, is appended to os.Environ() and passed to the
// child as cmd.Env. Used by the egress-proxy plumbing to inject
Env []string
}
Runner executes subprocesses on behalf of coily verbs. Build one in main with the default Resolver and plumb it through to verbs that need it.
func (*Runner) Capture ¶
Capture runs bin with argv and returns stdout as bytes. Stderr is forwarded to the Runner's Stderr (defaulting to discard if nil). Useful for verbs