exec

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConditionalCheck

func GetConditionalCheck(conditionals ...string) func(line string) bool

GetConditionalCheck return a function that can be used to check each line of output for content that indicates success.

func HandleOutput

func HandleOutput(in io.ReadCloser, log log.Logger, permitted func(string) bool, permissible chan<- bool)

HandleOutput take the supplied output and print it to screen checking for matches in the output to indicate if the output indicates success.

func Run

func Run(command string, log log.Logger, conditionals ...string) error

Run the supplied command.

func RunArgs

func RunArgs(command string, args []string, dir string, log log.Logger, conditionals ...string) error

RunArgs run the command with supplied args (not safe for args that require whitespace).

func RunDir

func RunDir(command string, dir string, log log.Logger, conditionals ...string) error

RunDir run the supplied command from the specified directory.

func RunStack

func RunStack(stack []*RunCmd, log log.Logger, conditionals ...string) (err error)

RunStack take the supplied stack of commands and run it if any conditionals are satisfied in the output.

Types

type Pipe

type Pipe struct {
	Cmd  string
	Args []string
}

type RunCmd

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

func CreateRunStack

func CreateRunStack(pipe []string, dir string) []*RunCmd

CreateRunStack create a run stack from the slice of command strings.

func CreateRunStackWithArgs

func CreateRunStackWithArgs(pipe []Pipe, dir string) []*RunCmd

CreateRunStackWithArgs create a run stack from the slice of Pipe structs, should automatically chain the stdout of the previous command into the stdin of the subsequent command.

Jump to

Keyboard shortcuts

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