// TODO: Remove this hack and replace it with a proper way to run commands live on windows. We still have an issue where if a password is requested, the request for a password is written straight to stdout because we can't control the stdout of a subprocess of a subprocess. Keep an eye on https://github.com/creack/pty/pull/109
funcRunCommandWithOutputLiveWrapper(
c*OSCommand,
cmdObjICmdObj,
writerio.Writer,
outputfunc(string)string,
)error{
returnRunCommandWithOutputLiveAux(
c,
cmdObj,
writer,
output,
func(cmd*exec.Cmd)(*cmdHandler,error){
stdoutReader,stdoutWriter:=io.Pipe()
cmd.Stdout=stdoutWriter
buf:=&Buffer{}
cmd.Stdin=buf
iferr:=cmd.Start();err!=nil{
returnnil,err
}
// because we don't yet have windows support for a pty, we instead just
// pass our standard stream handlers and because there's no pty to close