shell

package
v0.6.8 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Environ

func Environ() []string

func Fatal added in v0.6.8

func Fatal(msg string)

func Getenv

func Getenv(key string) string

func Lines added in v0.6.5

func Lines(name string, args ...string) ([]string, error)

func Output

func Output(name string, args ...string) (string, error)

func RequireCommand added in v0.6.8

func RequireCommand(name string) error

func Run

func Run(cmd string) (string, error)

func Setenv

func Setenv(key string, value string) error

func Unsetenv

func Unsetenv(key string) error

func Which

func Which(name string) bool

Types

type Command

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

func Args

func Args(cmd Command, args ...string) Command

func New

func New(name string, args ...string) Command

func (Command) Dir added in v0.6.8

func (cmd Command) Dir(path string) Command

func (Command) Env added in v0.6.8

func (cmd Command) Env(key string, value string) Command

func (Command) Execute added in v0.6.8

func (cmd Command) Execute() Result

func (Command) Flag added in v0.6.8

func (cmd Command) Flag(name string, value string) Command

func (Command) FlagIf added in v0.6.8

func (cmd Command) FlagIf(condition bool, args ...string) Command

func (Command) Output added in v0.6.8

func (cmd Command) Output() (string, error)

func (Command) Preview added in v0.6.8

func (cmd Command) Preview() string

func (Command) Timeout added in v0.6.8

func (cmd Command) Timeout(seconds int) Command

type Result

type Result struct {
	Stdout   []byte
	Stderr   []byte
	ExitCode int
	Err      error
}

func (Result) Require added in v0.6.8

func (result Result) Require() (string, error)

func (Result) Success added in v0.6.8

func (result Result) Success() bool

Jump to

Keyboard shortcuts

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