Commit f7b1799a authored by Jason Simmons's avatar Jason Simmons

Do not check for an existing package map if a command is going to run "pub...

Do not check for an existing package map if a command is going to run "pub get" to update the package map (#3202)

Also remove a redundant check for the --pub option in the run command
parent 412ce9d2
...@@ -10,7 +10,6 @@ import 'package:path/path.dart' as path; ...@@ -10,7 +10,6 @@ import 'package:path/path.dart' as path;
import '../application_package.dart'; import '../application_package.dart';
import '../base/common.dart'; import '../base/common.dart';
import '../build_configuration.dart'; import '../build_configuration.dart';
import '../dart/pub.dart';
import '../device.dart'; import '../device.dart';
import '../globals.dart'; import '../globals.dart';
import '../runner/flutter_command.dart'; import '../runner/flutter_command.dart';
...@@ -82,16 +81,6 @@ class RunCommand extends RunCommandBase { ...@@ -82,16 +81,6 @@ class RunCommand extends RunCommandBase {
@override @override
bool get requiresDevice => true; bool get requiresDevice => true;
@override
Future<int> run() async {
if (argResults['pub']) {
int exitCode = await pubGet();
if (exitCode != 0)
return exitCode;
}
return await super.run();
}
@override @override
Future<int> runInProject() async { Future<int> runInProject() async {
bool clearLogs = argResults['clear-logs']; bool clearLogs = argResults['clear-logs'];
......
...@@ -154,10 +154,13 @@ abstract class FlutterCommand extends Command { ...@@ -154,10 +154,13 @@ abstract class FlutterCommand extends Command {
} }
} }
String error = PackageMap.instance.checkValid(); // Validate the current package map only if we will not be running "pub get" later.
if (error != null) { if (!(_usesPubOption && argResults['pub'])) {
printError(error); String error = PackageMap.instance.checkValid();
return false; if (error != null) {
printError(error);
return false;
}
} }
return true; return true;
......
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