MCPcopy Create free account
hub / github.com/HoneyLLM/cli2ssh / pipeStdio

Function pipeStdio

internal/server/server.go:110–131  ·  view source on GitHub ↗

workaround for command hanging

(cmd *exec.Cmd, stdin io.Reader, stdout, stderr io.Writer)

Source from the content-addressed store, hash-verified

108
109// workaround for command hanging
110func pipeStdio(cmd *exec.Cmd, stdin io.Reader, stdout, stderr io.Writer) error {
111 cmdStdin, err := cmd.StdinPipe()
112 if err != nil {
113 return err
114 }
115
116 cmdStdout, err := cmd.StdoutPipe()
117 if err != nil {
118 return err
119 }
120
121 cmdStderr, err := cmd.StderrPipe()
122 if err != nil {
123 return err
124 }
125
126 go io.Copy(cmdStdin, stdin)
127 go io.Copy(stdout, cmdStdout)
128 go io.Copy(stderr, cmdStderr)
129
130 return nil
131}

Callers 1

CreateServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected