Documentation ¶
Index ¶
- func Run(cmd Cmd) (stdout, stderr string, err error)
- func Shell(cmd Cmd) (stdout, stderr string, err error)
- func Which(arg string, cmds ...string) (cmd string, output string, err error)
- func WhichArgs(argv []string, cmds ...string) (cmd string, output string, err error)
- func WhichWithResolver(cmds []string, resolve WhichResolver) (string, string, error)
- type Cmd
- type WhichResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WhichWithResolver ¶
func WhichWithResolver(cmds []string, resolve WhichResolver) (string, string, error)
WhichWithResolver is `Which` with a custom resolution strategy.
Types ¶
type Cmd ¶
type Cmd struct { Name string // Executable name. Argv []string // Executable arguments. Command string // Shell command. Dir string // The Command's working directory. // If neither Env nor WithEnv are set, the environment is inherited from os.Environ(). Env map[string]string // If set, the command's environment is _set_ to Env. WithEnv map[string]string // If set, the command's environment is _added_ to WithEnv. }
Cmd represents a single command. If Name and Argv are set, this is treated as an executable. If Command is set, this is treated as a shell command.
Click to show internal directories.
Click to hide internal directories.