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