From 7dac294cb3ff98b786ea85a04a49b049ecfcbd40 Mon Sep 17 00:00:00 2001 From: Jaime Wren Date: Tue, 31 Mar 2020 19:49:16 +0000 Subject: [PATCH] Minor cleanup in pub.dart, pub command in dartdev Change-Id: I38c915502e8ff98fc13fba737913c61e0940cdf6 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141901 Auto-Submit: Jaime Wren Commit-Queue: Devon Carew Reviewed-by: Devon Carew --- pkg/dartdev/lib/src/commands/pub.dart | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/dartdev/lib/src/commands/pub.dart b/pkg/dartdev/lib/src/commands/pub.dart index d7970bc3542..2d983df73b5 100644 --- a/pkg/dartdev/lib/src/commands/pub.dart +++ b/pkg/dartdev/lib/src/commands/pub.dart @@ -30,8 +30,12 @@ class PubCommand extends DartdevCommand { // and we want to guarantee that the result (the help text for the console) // is printed before command exits. final result = Process.runSync(command, args); - stderr.write(result.stderr); - stdout.write(result.stdout); + if (result.stderr.isNotEmpty) { + stderr.write(result.stderr); + } + if (result.stdout.isNotEmpty) { + stdout.write(result.stdout); + } } @override