diff --git a/packages/flutter_tools/lib/src/dart/pub.dart b/packages/flutter_tools/lib/src/dart/pub.dart index 10dd247f27..6d2c2b3f6e 100644 --- a/packages/flutter_tools/lib/src/dart/pub.dart +++ b/packages/flutter_tools/lib/src/dart/pub.dart @@ -124,7 +124,8 @@ typedef String MessageFilter(String message); /// applying filtering. The pub process will not receive anything on its stdin stream. /// /// The `--trace` argument is passed to `pub` (by mutating the provided -/// `arguments` list) unless `showTraceForErrors` is false. +/// `arguments` list) when `showTraceForErrors` is true, and when `showTraceForErrors` +/// is null/unset, and `isRunningOnBot` is true. /// /// [context] provides extra information to package server requests to /// understand usage. @@ -134,8 +135,10 @@ Future pub(List arguments, { MessageFilter filter, String failureMessage: 'pub failed', @required bool retry, - bool showTraceForErrors: true, + bool showTraceForErrors, }) async { + showTraceForErrors ??= isRunningOnBot; + if (showTraceForErrors) arguments.insert(0, '--trace'); int attempts = 0;