execute

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 6 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

type Executor interface {
	// Errors writes command errors to stderr during execution.
	Errors(cmd *exec.Cmd, targetDir string, action string) error
	// Output returns the output of the command as a string.
	Output(cmd *exec.Cmd, targetDir string, action string) (string, error)
	// CommandExists returns true if the command exists in the path.
	CommandExists(cmd string) bool
}

func NewOsExecutor

func NewOsExecutor() Executor

type OsExecutor

type OsExecutor struct{}

OsExecutor implements Executor using the os/exec package.

func (OsExecutor) CommandExists

func (OsExecutor) CommandExists(cmd string) bool

func (OsExecutor) Errors

func (OsExecutor) Errors(cmd *exec.Cmd, targetDir string, action string) error

Action string is used to log command info and wrap any returned errors

func (OsExecutor) Output

func (OsExecutor) Output(cmd *exec.Cmd, targetDir string, action string) (string, error)

Jump to

Keyboard shortcuts

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