From e6128a0c1457017d84835520ff20e391905dda28 Mon Sep 17 00:00:00 2001 From: Todd Volkert Date: Thu, 18 Jul 2019 22:22:22 -0700 Subject: [PATCH] Fix `flutter pub -v` (#36513) When we were running `pub` within `flutter pub`, we were unconditionally including the `--verbosity=warning` argument. Then we were conditionally including `--verbose` if we were running in verbose mode. However, the former argument supersedes the latter, and we were never able to run `pub` in verbose mode. --- .../flutter_tools/lib/src/commands/update_packages.dart | 7 ++++++- packages/flutter_tools/lib/src/dart/pub.dart | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/flutter_tools/lib/src/commands/update_packages.dart b/packages/flutter_tools/lib/src/commands/update_packages.dart index fff606c819..1ab825720d 100644 --- a/packages/flutter_tools/lib/src/commands/update_packages.dart +++ b/packages/flutter_tools/lib/src/commands/update_packages.dart @@ -249,7 +249,12 @@ class UpdatePackagesCommand extends FlutterCommand { fakePackage.createSync(); fakePackage.writeAsStringSync(_generateFakePubspec(dependencies.values)); // First we run "pub upgrade" on this generated package: - await pubGet(context: PubContext.updatePackages, directory: tempDir.path, upgrade: true, checkLastModified: false); + await pubGet( + context: PubContext.updatePackages, + directory: tempDir.path, + upgrade: true, + checkLastModified: false, + ); // Then we run "pub deps --style=compact" on the result. We pipe all the // output to tree.fill(), which parses it so that it can create a graph // of all the dependencies so that we can figure out the transitive diff --git a/packages/flutter_tools/lib/src/dart/pub.dart b/packages/flutter_tools/lib/src/dart/pub.dart index ca694e9b94..b31caf8b02 100644 --- a/packages/flutter_tools/lib/src/dart/pub.dart +++ b/packages/flutter_tools/lib/src/dart/pub.dart @@ -96,9 +96,9 @@ Future pubGet({ 'Running "flutter pub $command" in ${fs.path.basename(directory)}...', timeout: timeoutConfiguration.slowOperation, ); + final bool verbose = FlutterCommand.current != null && FlutterCommand.current.globalResults['verbose']; final List args = [ - '--verbosity=warning', - if (FlutterCommand.current != null && FlutterCommand.current.globalResults['verbose']) '--verbose', + if (verbose) '--verbose' else '--verbosity=warning', ...[command, '--no-precompile'], if (offline) '--offline', ];