shell

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(options *Options, command string, args ...string) error

Execute a shell command

Types

type Options

type Options struct {
	WorkingDirectory string
	Stdout           []OutputProcessor
	Stderr           []OutputProcessor
	Env              map[string]string
}

Options when running shell command

type OutputProcessor

type OutputProcessor interface {
	Write(line string) bool
}

OutputProcessor can process a line from command output, does not separate between stdout and stderr. If it returns true it will proceed to next OutputProcessor in line. With false it will not proceed to other processors

func Processors

func Processors(pros ...OutputProcessor) []OutputProcessor

Processors is a helper function to create a list of processors

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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