executor

package
v0.0.0-...-ee2d30e Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EnvVars

type EnvVars map[string]string

type Executor

type Executor interface {
	Exec(command string, args ...string) error
	ExecWithOut(command string, args ...string) ([]byte, error)
	ExecInDir(command string, dir string, args ...string) error
}

Executor executes commands shelling out and binding the stdout and stderr to the os ones

func NewShellExecutor

func NewShellExecutor(envVars EnvVars) Executor

NewShellExecutor creates a new executor that runs commands

type ShellExecutor

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

ShellExecutor an executor that shells out to run commands

func (ShellExecutor) Exec

func (e ShellExecutor) Exec(command string, args ...string) error

Exec execute the command with the specified args

func (ShellExecutor) ExecInDir

func (e ShellExecutor) ExecInDir(command string, dir string, args ...string) error

ExecInDir executes the command inside the directory with the specified args

func (ShellExecutor) ExecWithOut

func (e ShellExecutor) ExecWithOut(command string, args ...string) ([]byte, error)

ExecWithOut executes the command with the specified args and returns the output

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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