Unverified Commit e6128a0c authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

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.
parent 1170105e
......@@ -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
......
......@@ -96,9 +96,9 @@ Future<void> 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<String> args = <String>[
'--verbosity=warning',
if (FlutterCommand.current != null && FlutterCommand.current.globalResults['verbose']) '--verbose',
if (verbose) '--verbose' else '--verbosity=warning',
...<String>[command, '--no-precompile'],
if (offline) '--offline',
];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment