Don't write flutter stderr to output

Add to the extension thrown if it fails instead.
This commit is contained in:
Danny Tuppeny 2018-05-03 07:43:04 +01:00 committed by Danny Tuppeny
parent 83296e74a1
commit 19ad6528e8

View File

@ -138,8 +138,9 @@ Future<void> _getPackages() async {
'get'
];
final Process process = await processManager.start(command);
process.stderr.transform(utf8.decoder).listen(print);
final StringBuffer errorOutput = new StringBuffer();
process.stderr.transform(utf8.decoder).listen(errorOutput.write);
final int exitCode = await process.exitCode;
if (exitCode != 0)
throw new Exception('flutter packages get failed');
throw new Exception('flutter packages get failed: ${errorOutput.toString()}');
}