diff --git a/packages/pigeon/tool/shared/generation.dart b/packages/pigeon/tool/shared/generation.dart index de03c3c94245..00ec45b8d319 100644 --- a/packages/pigeon/tool/shared/generation.dart +++ b/packages/pigeon/tool/shared/generation.dart @@ -246,5 +246,6 @@ Future formatAllFiles({required String repositoryRoot}) { '--packages=pigeon', ], workingDirectory: repositoryRoot, + streamOutput: false, logFailure: true); } diff --git a/packages/pigeon/tool/shared/process_utils.dart b/packages/pigeon/tool/shared/process_utils.dart index a6a904b945fd..28c816f18b1b 100644 --- a/packages/pigeon/tool/shared/process_utils.dart +++ b/packages/pigeon/tool/shared/process_utils.dart @@ -3,27 +3,19 @@ // found in the LICENSE file. import 'dart:async'; -import 'dart:io' show Process, stderr, stdout; - -Future _streamOutput(Future processFuture) async { - final Process process = await processFuture; - await Future.wait(>[ - stdout.addStream(process.stdout), - stderr.addStream(process.stderr), - ]); - return process; -} +import 'dart:io' show Process, ProcessStartMode, stderr, stdout; Future runProcess(String command, List arguments, {String? workingDirectory, bool streamOutput = true, bool logFailure = false}) async { - final Future future = Process.start( + final Process process = await Process.start( command, arguments, workingDirectory: workingDirectory, + mode: + streamOutput ? ProcessStartMode.inheritStdio : ProcessStartMode.normal, ); - final Process process = await (streamOutput ? _streamOutput(future) : future); final int exitCode = await process.exitCode; if (exitCode != 0 && logFailure) { // ignore: avoid_print