command

package
v1.41.0 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: Apache-2.0 Imports: 9 Imported by: 28

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExecCommand = exec.Command

ExecCommand defines how to execute os commands

Functions

This section is empty.

Types

type Command

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

Command defines the information required for executing a call to any executable

func (*Command) RunExecutable

func (c *Command) RunExecutable(executable string, params ...string) error

RunExecutable runs the specified executable with parameters !! While the cmd.Env is applied during command execution, it is NOT involved when the actual executable is resolved.

Thus the executable needs to be on the PATH of the current process and it is not sufficient to alter the PATH on cmd.Env.

func (*Command) RunShell

func (c *Command) RunShell(shell, script string) error

RunShell runs the specified command on the shell

func (*Command) SetDir added in v1.15.0

func (c *Command) SetDir(d string)

SetDir sets the working directory for the execution

func (*Command) SetEnv added in v1.15.0

func (c *Command) SetEnv(e []string)

SetEnv sets explicit environment variables to be used for execution

func (*Command) Stderr

func (c *Command) Stderr(stderr io.Writer)

Stderr ..

func (*Command) Stdout

func (c *Command) Stdout(stdout io.Writer)

Stdout ..

Jump to

Keyboard shortcuts

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