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;
import '../application_package.dart';
import '../base/common.dart';
import '../build_configuration.dart';
import '../dart/pub.dart';
import '../device.dart';
import '../globals.dart';
import '../runner/flutter_command.dart';
......@@ -82,16 +81,6 @@ class RunCommand extends RunCommandBase {
@override
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
Future<int> runInProject() async {
bool clearLogs = argResults['clear-logs'];
......
......@@ -154,11 +154,14 @@ abstract class FlutterCommand extends Command {
}
}
// Validate the current package map only if we will not be running "pub get" later.
if (!(_usesPubOption && argResults['pub'])) {
String error = PackageMap.instance.checkValid();
if (error != null) {
printError(error);
return false;
}
}
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