Skip to content

Commit f27dcfd

Browse files
authored
Have pub deps --json quiet when no terminal is attached (#4602)
1 parent 279d936 commit f27dcfd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/src/command/deps.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ class DepsCommand extends PubCommand {
9999
];
100100
final toVisit = [...workspacePackageNames];
101101
final packagesJson = <dynamic>[];
102-
final graph = await entrypoint.packageGraph;
102+
103+
// Avoid polluting stdout when outputting json.
104+
final graph = await log.errorsOnlyUnlessTerminal(
105+
() async => await entrypoint.packageGraph,
106+
);
107+
103108
while (toVisit.isNotEmpty) {
104109
final current = toVisit.removeLast();
105110
if (visited.contains(current)) continue;

0 commit comments

Comments
 (0)