cmdrunner

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExitCode

func GetExitCode(err error) (int, error)

GetExitCode tries to retrieve the exit code from an exit error

func IsCommandOutputNop

func IsCommandOutputNop(cmd *Command) bool

IsCommandOutputNop checks if a command exits with no output or error

func Run

func Run(command string) error

Run command

Types

type Command

type Command struct {
	Name         string
	Args         []string
	Env          []string
	Dir          string
	TeePipe      bool
	Process      *os.Process
	ProcessState *os.ProcessState
	Stdin        io.Reader
	Stderr       *bytes.Buffer
	Stdout       *bytes.Buffer
	ExitCode     int
	Error        error
	// contains filtered or unexported fields
}

Command structure

func (*Command) Prepare

func (cmd *Command) Prepare() *exec.Cmd

Prepare prepares the executable command

func (*Command) Run

func (cmd *Command) Run()

Run runs the command

func (*Command) Start

func (cmd *Command) Start()

Start command

func (*Command) Started

func (cmd *Command) Started() bool

Started tells if the command was started or not

func (*Command) Terminate

func (cmd *Command) Terminate() error

Terminate sends a SIGTERM signal

func (*Command) Wait

func (cmd *Command) Wait()

Wait for command to end

Jump to

Keyboard shortcuts

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