mirror of
https://github.com/docker/docker-credential-helpers.git
synced 2026-06-13 16:01:28 +05:30
Caller of cred helpers would now see the stderr returns from cred helpers
Signed-off-by: shhsu@microsoft.com <shhsu@microsoft.com>
This commit is contained in:
+8
-1
@@ -2,6 +2,7 @@ package client
|
||||
|
||||
import (
|
||||
"io"
|
||||
"os"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
@@ -17,10 +18,16 @@ type ProgramFunc func(args ...string) Program
|
||||
// NewShellProgramFunc creates programs that are executed in a Shell.
|
||||
func NewShellProgramFunc(name string) ProgramFunc {
|
||||
return func(args ...string) Program {
|
||||
return &Shell{cmd: exec.Command(name, args...)}
|
||||
return &Shell{cmd: newCmdRedirectErr(name, args)}
|
||||
}
|
||||
}
|
||||
|
||||
func newCmdRedirectErr(name string, args []string) *exec.Cmd {
|
||||
newCmd := exec.Command(name, args...)
|
||||
newCmd.Stderr = os.Stderr
|
||||
return newCmd
|
||||
}
|
||||
|
||||
// Shell invokes shell commands to talk with a remote credentials helper.
|
||||
type Shell struct {
|
||||
cmd *exec.Cmd
|
||||
|
||||
Reference in New Issue
Block a user