MCPcopy
hub / github.com/bitfield/script / Wait

Method Wait

script.go:958–964  ·  view source on GitHub ↗

Wait reads the pipe to completion and returns any error present on the pipe, or nil otherwise. This is mostly useful for waiting until concurrent filters have completed (see [Pipe.Filter]).

()

Source from the content-addressed store, hash-verified

956// the pipe, or nil otherwise. This is mostly useful for waiting until
957// concurrent filters have completed (see [Pipe.Filter]).
958func (p *Pipe) Wait() error {
959 _, err := io.Copy(io.Discard, p)
960 if err != nil {
961 p.SetError(err)
962 }
963 return p.Error()
964}
965
966// WithEnv sets the environment for subsequent [Pipe.Exec] and [Pipe.ExecForEach]
967// commands to the string slice env, using the same format as [os/exec.Cmd.Env].

Calls 2

SetErrorMethod · 0.95
ErrorMethod · 0.95