Command.Type: scriptFile no longer requests psudoterminal
Some checks failed
ci/woodpecker/push/go-lint Pipeline failed
Some checks failed
ci/woodpecker/push/go-lint Pipeline failed
This commit is contained in:
@@ -690,18 +690,17 @@ func (command *Command) runScriptFile(session *ssh.Session, cmdCtxLogger, global
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
// session.Stdin = script
|
||||
session.Stdin = script
|
||||
|
||||
modes := ssh.TerminalModes{
|
||||
ssh.ECHO: 0,
|
||||
ssh.ECHOCTL: 0,
|
||||
ssh.TTY_OP_ISPEED: 14400,
|
||||
ssh.TTY_OP_OSPEED: 14400,
|
||||
}
|
||||
// modes := ssh.TerminalModes{
|
||||
// ssh.ECHO: 0,
|
||||
// ssh.ECHOCTL: 0,
|
||||
// ssh.TTY_OP_ISPEED: 14400,
|
||||
// ssh.TTY_OP_OSPEED: 14400,
|
||||
// }
|
||||
|
||||
session.RequestPty("xterm", 80, 40, modes)
|
||||
// session.RequestPty("xterm", 80, 40, modes)
|
||||
|
||||
stdin, _ := session.StdinPipe()
|
||||
stdout, stdOutErr := session.StdoutPipe()
|
||||
if stdOutErr != nil {
|
||||
return nil, fmt.Errorf("error getting stdout pipe: %w", stdOutErr)
|
||||
@@ -718,8 +717,6 @@ func (command *Command) runScriptFile(session *ssh.Session, cmdCtxLogger, global
|
||||
LogOutputToFile = true
|
||||
}
|
||||
|
||||
stdin.Write(script.Bytes())
|
||||
|
||||
stdOutput, stdoOutReadErr := io.ReadAll(stdout)
|
||||
if err := session.Wait(); err != nil {
|
||||
stdOutBuff := bytes.NewBuffer(stdOutput)
|
||||
|
||||
Reference in New Issue
Block a user