Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Exec ¶
func Exec(dir string, env map[string]string, stdout, stderr io.Writer, cmd string, args ...string) (ran bool, err error)
Exec executes the command, piping its stdout and stderr to the given writers. If the command fails, it will return an error that, if returned from a target or mg.Deps call, will cause mage to exit with the same code as the command failed with. Env is a list of environment variables to set when running the command, these override the current environment variables set (which are also passed to the command). cmd and args may include references to environment variables in $FOO format, in which case these will be expanded before the command is run.
Ran reports if the command ran (rather than was not found or not executable). Code reports the exit code the command returned if it ran. If err == nil, ran is always true and code is always 0.
Types ¶
This section is empty.