command

package
v2.4.9 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: GPL-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandArg

func ExpandArg(arg string, env map[string]any) string

ExpandArgs expands the arguments.

Types

type Error

type Error struct {
	// The error message.
	Message string

	// An optional error that caused this error.
	Err error

	// The step or steplist that caused the error.
	Step     Step
	Steplist *StepList
}

func (*Error) Error

func (e *Error) Error() string

Error returns the error message.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap returns the underlying error.

type Step

type Step struct {
	Name    string   `yaml:"name"`    // The name of the step.
	Command string   `yaml:"command"` // The command to run.
	Args    []string `yaml:"args"`    // The arguments to pass to the command.
}

CommandStep represents a command to run.

func (Step) Execute

func (s Step) Execute(env map[string]any) ([]byte, []byte, error)

Execute runs the command.

func (*Step) ParseArgs

func (s *Step) ParseArgs(env map[string]any) ([]string, []string)

ParseArgs parses the arguments.

type StepList

type StepList struct {
	Steps []Step `yaml:"steps"`
}

func (*StepList) Execute

func (l *StepList) Execute(env map[string]any) error

Jump to

Keyboard shortcuts

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