cmd

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Cmd     string
	Env     []string
	Dir     string
	Timeout time.Duration
	// contains filtered or unexported fields
}

Command represents a single command which can be executed

func NewCommand

func NewCommand(cmd string) *Command

NewCommand creates a new command

func (*Command) AddEnv added in v0.3.0

func (c *Command) AddEnv(key string, value string)

func (*Command) Execute

func (c *Command) Execute() error

Execute executes the commande

func (*Command) Executed

func (c *Command) Executed() bool

Executed returns if the command was already executed

func (*Command) ExitCode

func (c *Command) ExitCode() int

ExitCode returns the exit code of the command

func (*Command) SetTimeoutMS

func (c *Command) SetTimeoutMS(ms int)

SetTimeoutMS sets the timeout in milliseconds

func (*Command) Stderr

func (c *Command) Stderr() string

Stderr returns the output to stderr

func (*Command) Stdout

func (c *Command) Stdout() string

Stdout returns the output to stdout

Jump to

Keyboard shortcuts

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