Documentation
¶
Overview ¶
Package execute is a simple package that wraps the os/exec Command features for convenient use in asdf. It was inspired by https://github.com/chen-keinan/go-command-eval
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentEnv ¶ added in v0.16.5
CurrentEnv returns the current environment as a map
func MapToSlice ¶
MapToSlice converts an env map to env slice suitable for syscall.Exec
func MergeEnv ¶ added in v0.16.5
MergeEnv takes two maps with string keys and values and merges them.
func MergeWithCurrentEnv ¶ added in v0.16.5
MergeWithCurrentEnv merges the provided map into the current environment variables
func SliceToMap ¶ added in v0.16.5
SliceToMap converts an env map to env slice suitable for syscall.Exec
Types ¶
type Command ¶
type Command struct { Command string Expression string Args []string Stdin io.Reader Stdout io.Writer Stderr io.Writer Env map[string]string }
Command represents a Bash command that can be executed by asdf
func New ¶
New takes a string containing the path to a Bash script, and a slice of string arguments and returns a Command struct
func NewExpression ¶
NewExpression takes a string containing a Bash expression and a slice of string arguments and returns a Command struct