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.
This commit is contained in:
@@ -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',
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user