run

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Runner

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

Runner is responsible for running Tasks.

func NewRunner

func NewRunner(ts models.Tasks, dir string) (runner Runner, err error)

NewRunner takes Tasks and returns a Runner. If the OS is windows commands will be run using `cmd \C` and separated by `&&`. Otherwise, commands will be run using `bash -c` and separated by `;`.

NewRunner will return an error in the case that Dependent tasks are cyclical, invalid or at a larger depth than 50.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, name string, inputs []string) error

Run runs a task given a string name. Task dependencies will be run first, an error will return if any fail. Task commands are run next, in case of a non zero result an error will return.

func (*Runner) ValidateDependencies

func (r *Runner) ValidateDependencies(task string, prevTasks []string) error

ValidateDependencies checks that task dependencies follow these rules: - No deeper dependency trees than maxDeps. - Dependencies must exist as tasks. - No cyclical dependencies.

type ScriptRunner added in v0.0.152

type ScriptRunner interface {
	Execute(ctx context.Context, text string, env, args []string, dir, logPrefix string) error
}

Jump to

Keyboard shortcuts

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