runner

package
v1.4.9 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StatusOk status = iota
	StatusErr
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CommandExecutor added in v1.1.0

type CommandExecutor struct{}

func (CommandExecutor) Execute added in v1.1.0

func (e CommandExecutor) Execute(opts ExecuteOptions, out io.Writer) error

func (CommandExecutor) RawExecute added in v1.1.0

func (e CommandExecutor) RawExecute(command []string, out io.Writer) error

type ExecuteOptions added in v1.1.3

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

ExecutorOptions contains the options that control the execution.

type Executor added in v1.1.0

type Executor interface {
	Execute(opts ExecuteOptions, out io.Writer) error
	RawExecute(command []string, out io.Writer) error
}

Executor provides an interface for command execution. It is used here for testing purpose mostly.

type Opts added in v1.2.6

type Opts struct {
	Fs              afero.Fs
	Repo            *git.Repository
	Hook            *config.Hook
	HookName        string
	GitArgs         []string
	ResultChan      chan Result
	SkipSettings    log.SkipSettings
	DisableTTY      bool
	AllFiles        bool
	Files           []string
	RunOnlyCommands []string
}

type Result

type Result struct {
	Name   string
	Text   string
	Status status
}

type Runner

type Runner struct {
	Opts
	// contains filtered or unexported fields
}

Runner responds for actual execution and handling the results.

func NewRunner

func NewRunner(opts Opts) *Runner

func (*Runner) RunAll

func (r *Runner) RunAll(sourceDirs []string)

RunAll runs scripts and commands. LFS hook is executed at first if needed.

Jump to

Keyboard shortcuts

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