@@ -34,7 +34,7 @@ import (
3434 "arduino.cc/builder/i18n"
3535 "arduino.cc/builder/props"
3636 "arduino.cc/builder/utils"
37- "bufio "
37+ "bytes "
3838 "fmt"
3939 "os"
4040 "os/exec"
@@ -327,31 +327,16 @@ func PrepareCommandForRecipe(properties map[string]string, recipe string, remove
327327 return command , nil
328328}
329329
330- func ExecRecipeCollectStdErr (properties map [string ]string , recipe string , removeUnsetProperties bool , echoCommandLine bool , echoOutput bool , logger i18n.Logger ) (string , error , error ) {
330+ func ExecRecipeCollectStdErr (properties map [string ]string , recipe string , removeUnsetProperties bool , echoCommandLine bool , echoOutput bool , logger i18n.Logger ) (string , error ) {
331331 command , err := PrepareCommandForRecipe (properties , recipe , removeUnsetProperties , echoCommandLine , echoOutput , logger )
332332 if err != nil {
333- return "" , nil , utils .WrapError (err )
334- }
335-
336- stderr , err := command .StderrPipe ()
337- if err != nil {
338- return "" , nil , utils .WrapError (err )
339- }
340-
341- err = command .Start ()
342- if err != nil {
343- return "" , nil , utils .WrapError (err )
344- }
345-
346- collectedStdErr := ""
347- sc := bufio .NewScanner (stderr )
348- for sc .Scan () {
349- collectedStdErr += sc .Text () + "\n "
333+ return "" , utils .WrapError (err )
350334 }
351335
352- err = command .Wait ()
353-
354- return collectedStdErr , err , nil
336+ buffer := & bytes.Buffer {}
337+ command .Stderr = buffer
338+ command .Run ()
339+ return string (buffer .Bytes ()), nil
355340}
356341
357342func RemoveHyphenMDDFlagFromGCCCommandLine (properties map [string ]string ) {
0 commit comments