writeProcessStreams static method

void writeProcessStreams(
  1. ProcessResult result, {
  2. bool toStderr = false,
})

Implementation

static void writeProcessStreams(
  ProcessResult result, {
  bool toStderr = false,
}) {
  final out = withoutArtifactProtocolLines(result.stdout?.toString() ?? '');
  final err = withoutArtifactProtocolLines(result.stderr?.toString() ?? '');
  if (out.isNotEmpty) {
    if (toStderr) {
      stderr.write(out);
    } else {
      stdout.write(out);
    }
  }
  if (err.isNotEmpty) stderr.write(err);
}