cmd

package
v0.0.0-...-ecdd562 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

Cmd is a wrapper for exec.Cmd to allow for more elegant construction for the purposes of this package.

func New

func New(s string, vals map[string]string) (*Cmd, error)

New creates a Cmd out of the string "s" with value substitutions from vals.

func (*Cmd) BaseEnv

func (c *Cmd) BaseEnv() *Cmd

BaseEnv replaces the current exec.Cmd.Env and sets up GOPATH, HOME, and PATH.

func (*Cmd) Debug

func (c *Cmd) Debug(on bool) *Cmd

Debug if set to on will send the command stdout and stderr to the os.Stdout and os.Stderr. Defaults to true.

func (*Cmd) Env

func (c *Cmd) Env(env ...string) *Cmd

Env allows appending to the underling exec.Cmd.Env value.

func (*Cmd) Exec

func (c *Cmd) Exec() *exec.Cmd

Exec returns the underlying *exec.Cmd.

func (*Cmd) Run

func (c *Cmd) Run() ([]byte, error)

Run executes the command

func (*Cmd) String

func (c *Cmd) String() string

Jump to

Keyboard shortcuts

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