forked from firka/flutter
Preserve stdout colors of subprocesses run by felt (flutter/engine#13209)
This commit is contained in:
@@ -230,7 +230,6 @@ class TestCommand extends Command<bool> {
|
||||
@required bool expectFailure,
|
||||
}) async {
|
||||
final List<String> testArgs = <String>[
|
||||
'--no-color',
|
||||
...<String>['-r', 'compact'],
|
||||
'--concurrency=$concurrency',
|
||||
if (isDebug) '--pause-after-load',
|
||||
|
||||
@@ -43,8 +43,9 @@ Future<int> runProcess(
|
||||
executable,
|
||||
arguments,
|
||||
workingDirectory: workingDirectory,
|
||||
mode: io.ProcessStartMode.inheritStdio,
|
||||
);
|
||||
final int exitCode = await _forwardIOAndWait(process);
|
||||
final int exitCode = await process.exitCode;
|
||||
if (mustSucceed && exitCode != 0) {
|
||||
throw ProcessException(
|
||||
description: 'Sub-process failed.',
|
||||
@@ -82,16 +83,6 @@ Future<String> evalProcess(
|
||||
return result.stdout;
|
||||
}
|
||||
|
||||
Future<int> _forwardIOAndWait(io.Process process) {
|
||||
final StreamSubscription stdoutSub = process.stdout.listen(io.stdout.add);
|
||||
final StreamSubscription stderrSub = process.stderr.listen(io.stderr.add);
|
||||
return process.exitCode.then<int>((int exitCode) {
|
||||
stdoutSub.cancel();
|
||||
stderrSub.cancel();
|
||||
return exitCode;
|
||||
});
|
||||
}
|
||||
|
||||
@immutable
|
||||
class ProcessException implements Exception {
|
||||
ProcessException({
|
||||
|
||||
Reference in New Issue
Block a user