Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions pkg/pub_worker/lib/src/analyze.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// BSD-style license that can be found in the LICENSE file.

import 'dart:async';
import 'dart:convert' show JsonUtf8Encoder, utf8;
import 'dart:convert' show JsonUtf8Encoder, LineSplitter, Utf8Decoder, utf8;
import 'dart:io'
show Directory, File, IOException, Platform, Process, ProcessSignal, gzip;
import 'dart:isolate' show Isolate;
Expand Down Expand Up @@ -152,8 +152,14 @@ Future<void> _analyzePackage(
await pana.stdin.close();

await Future.wait<void>([
pana.stderr.forEach(log.add),
pana.stdout.forEach(log.add),
pana.stderr
.transform(Utf8Decoder(allowMalformed: true))
.transform(LineSplitter())
.forEach(log.writeln),
pana.stdout
.transform(Utf8Decoder(allowMalformed: true))
.transform(LineSplitter())
.forEach(log.writeln),
pana.exitOrTimeout(_panaTimeout, () {
log.writeln('TIMEOUT: pana sending SIGTERM/SIGKILL');
}),
Expand Down
Loading