Documentation ¶
Index ¶
- func CommandExists(name string) bool
- func CreateCommand(directory string, command string, args ...string) *exec.Cmd
- func RemoveEnv(env []string, key string) []string
- func RunCommand(directory string, command string, args ...string) (string, string, error)
- func RunCommandVerbose(directory string, command string, args ...string) error
- func RunCommandWithEnv(env []string, directory string, command string, args ...string) (string, string, error)
- func SetEnv(env []string, key string, value string) []string
- func UpsertEnv(env []string, key string, update func(v string) string) []string
- type Command
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommandExists ¶
CommandExists returns true if the given command can be found on the shell
func CreateCommand ¶
CreateCommand returns a *Cmd struct that when run, will run the given command + args in the given directory
func RunCommand ¶
RunCommand will run the given command + args in the given directory Will return stdout, stderr and error
func RunCommandVerbose ¶
RunCommandVerbose will run the given command + args in the given directory Will return an error if one occurs
func RunCommandWithEnv ¶
func RunCommandWithEnv(env []string, directory string, command string, args ...string) (string, string, error)
RunCommandWithEnv will run the given command + args in the given directory and using the specified env.
Env specifies the environment of the process. Each entry is of the form "key=value". If Env is nil, the new process uses the current process's environment.
Will return stdout, stderr and error