File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ export async function execProcess(
104104 stdoutText = await processOutput (
105105 iterateReader ( process . stdout ) ,
106106 options . stdout ,
107+ "stdout" ,
107108 ) ;
108109 process . stdout . close ( ) ;
109110 }
@@ -115,6 +116,7 @@ export async function execProcess(
115116 stderrText = await processOutput (
116117 iterator ,
117118 options . stderr ,
119+ "stderr" ,
118120 ) ;
119121 process . stderr . close ( ) ;
120122 }
@@ -161,12 +163,19 @@ function filteredAsyncIterator(
161163async function processOutput (
162164 iterator : AsyncIterable < Uint8Array > ,
163165 output ?: "piped" | "inherit" | "null" | number ,
166+ which ?: "stdout" | "stderr" ,
164167) : Promise < string > {
165168 const decoder = new TextDecoder ( ) ;
166169 let outputText = "" ;
167170 for await ( const chunk of iterator ) {
168171 if ( output === "inherit" || output === undefined ) {
169- info ( decoder . decode ( chunk ) , { newline : false } ) ;
172+ if ( which === "stdout" ) {
173+ Deno . stdout . writeSync ( chunk ) ;
174+ } else if ( which === "stderr" ) {
175+ Deno . stderr . writeSync ( chunk ) ;
176+ } else {
177+ info ( decoder . decode ( chunk ) , { newline : false } ) ;
178+ }
170179 }
171180 const text = decoder . decode ( chunk ) ;
172181 outputText += text ;
You can’t perform that action at this time.
0 commit comments