From 9199872054a9c1afaf25638acfa0c76c8175a0b0 Mon Sep 17 00:00:00 2001 From: Omar Kohl Date: Mon, 6 Mar 2023 16:12:10 +0100 Subject: [PATCH] fix erroneous docstring of sh.Exec() (#452) sh.Exec() uses the passed in stderr io.Writer to write the stderr output not "piping its stderr to mage's stderr". --- sh/cmd.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sh/cmd.go b/sh/cmd.go index 35d232a4..312de65a 100644 --- a/sh/cmd.go +++ b/sh/cmd.go @@ -89,14 +89,14 @@ func OutputWith(env map[string]string, cmd string, args ...string) (string, erro return strings.TrimSuffix(buf.String(), "\n"), err } -// Exec executes the command, piping its stderr to mage's stderr and -// piping its stdout to the given writer. 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. +// 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