exec

package
v0.3.22 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrMissingShell      = errors.New("missing shell")
	ErrUnrecognizedShell = errors.New("unrecognized shell")
)
View Source
var ErrMissingInput = errors.New("missing input")

Functions

This section is empty.

Types

type Process

type Process struct {
	Directory   string
	Environment []string

	Shell Shell

	Verbose bool

	Args []string
}

Process is a child process.

func (Process) Run

func (p Process) Run(ctx context.Context) error

Run executes the underlying function.

func (Process) String

func (p Process) String() string

type Shell

type Shell uint

Shell is the name of a shell program to use to execute a command in.

const (
	ShellUnknown Shell = iota
	ShellBash
	ShellCmd
	ShellPowerShell
	ShellPwsh
	ShellSh
	ShellZsh
)

func DefaultShell added in v0.1.1

func DefaultShell() Shell

DefaultShell returns the default shell, based on the platform.

func MustParseShell

func MustParseShell(input string) Shell

Parses an input string as a shell name but panics if it would fail.

func ParseShell

func ParseShell(input string) (Shell, error)

Parses an input string as a shell name.

NOTE: This is a best effort implementation. Please open an issue on GitHub if some values are missing: github.com/coffeebeats/gdbuild/issues/new?labels=bug&template=%F0%9F%90%9B-bug-report.md.

func (Shell) String

func (s Shell) String() string

String implements 'fmt.Stringer' for 'Shell'.

func (*Shell) UnmarshalText

func (s *Shell) UnmarshalText(bb []byte) error

Jump to

Keyboard shortcuts

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