exec

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 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, 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, conditionals ...string) error

Run the supplied command.

func RunArgs

func RunArgs(command string, args []string, dir string, 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, conditionals ...string) error

RunDir run the supplied command from the specified directory.

func RunStack

func RunStack(stack []*RunCmd, 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