sh

package module
v0.0.0-...-1234ee2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2025 License: MIT Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrFailedParsing = errors.New("failed to parse")

Functions

This section is empty.

Types

type Command

type Command interface {
	Identifier() string
	Run(ctx CommandContext) int
}

type CommandContext

type CommandContext struct {
	Args           []string
	Stdin          io.Reader
	Stdout, Stderr io.Writer
	Env            map[string]string
	Ctx            context.Context
}

type EnvImplementation

type EnvImplementation struct {
	ExportedEnv map[string]string
}

Temp EnvImplementation for basic export & expand stuff

func (EnvImplementation) Each

func (e EnvImplementation) Each(f func(name string, vr expand.Variable) bool)

func (EnvImplementation) Get

type ExitStatus

type ExitStatus int

func (ExitStatus) Error

func (e ExitStatus) Error() string

type FileInfo

type FileInfo struct {
	Type       FileType
	Executable bool
	Readable   bool
	Writable   bool
	Target     string
}

type FileType

type FileType int
const (
	FileNone FileType = iota
	FileRegular
	FileDir
	FileSymlink
)

type Runner

type Runner struct {
	// Env should not be accessed while the runner is running
	Env            map[string]string
	Commands       []Command
	Stdin          io.Reader
	Stdout, Stderr io.Writer
	FS             any

	StopOnError bool
	// contains filtered or unexported fields
}

func (*Runner) Clone

func (r *Runner) Clone() *Runner

func (*Runner) RunNode

func (r *Runner) RunNode(ctx context.Context, node syntax.Node) (err error)

func (*Runner) RunText

func (r *Runner) RunText(ctx context.Context, input io.Reader) error

RunText takes in a string with the current runner information and executes it. It is designed for explicit command+response (background tasks are waited on before return, when implemented)

type StatHandler

type StatHandler interface {
	Stat(ctx context.Context, path string) (FileInfo, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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