({stream, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo})
| 17 | |
| 18 | // Read the contents of `subprocess.std*` or `subprocess.all` and|or wait for its completion |
| 19 | export const waitForSubprocessStream = async ({stream, fdNumber, encoding, buffer, maxBuffer, lines, allMixed, stripFinalNewline, verboseInfo, streamInfo}) => { |
| 20 | if (!stream) { |
| 21 | return; |
| 22 | } |
| 23 | |
| 24 | const onStreamEnd = waitForStream(stream, fdNumber, streamInfo); |
| 25 | if (isInputFileDescriptor(streamInfo, fdNumber)) { |
| 26 | await onStreamEnd; |
| 27 | return; |
| 28 | } |
| 29 | |
| 30 | const [output] = await Promise.all([ |
| 31 | getStreamOutput({ |
| 32 | stream, |
| 33 | onStreamEnd, |
| 34 | fdNumber, |
| 35 | encoding, |
| 36 | buffer, |
| 37 | maxBuffer, |
| 38 | lines, |
| 39 | allMixed, |
| 40 | stripFinalNewline, |
| 41 | verboseInfo, |
| 42 | streamInfo, |
| 43 | }), |
| 44 | onStreamEnd, |
| 45 | ]); |
| 46 | return output; |
| 47 | }; |
no test coverage detected