Merge pull request #2571 from eseidelGoogle/run_pub_fail
`flutter run` should fail if `pub get` fails.
This commit is contained in:
commit
3d8176ed16
@ -81,8 +81,11 @@ class RunCommand extends RunCommandBase {
|
||||
|
||||
@override
|
||||
Future<int> run() async {
|
||||
if (argResults['pub'])
|
||||
await pubGet();
|
||||
if (argResults['pub']) {
|
||||
int exitCode = await pubGet();
|
||||
if (exitCode != 0)
|
||||
return exitCode;
|
||||
}
|
||||
return await super.run();
|
||||
}
|
||||
|
||||
|
@ -15,6 +15,8 @@ Future<int> _runPub(Directory directory, { bool upgrade: false }) async {
|
||||
for (FileSystemEntity dir in directory.listSync()) {
|
||||
if (dir is Directory && FileSystemEntity.isFileSync(dir.path + Platform.pathSeparator + 'pubspec.yaml')) {
|
||||
updateCount++;
|
||||
// TODO(eseidel): Should this fail immediately if pubGet fails?
|
||||
// Currently we're ignoring the return code.
|
||||
await pubGet(directory: dir.path, upgrade: upgrade, checkLastModified: false);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user