flutter run
should fail if pub get
fails.
Previously we were ignoring the return code and continuing. @devoncarew
This commit is contained in:
parent
8f603800ba
commit
3e2a4d9b4d
@ -81,8 +81,11 @@ class RunCommand extends RunCommandBase {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<int> run() async {
|
Future<int> run() async {
|
||||||
if (argResults['pub'])
|
if (argResults['pub']) {
|
||||||
await pubGet();
|
int exitCode = await pubGet();
|
||||||
|
if (exitCode != 0)
|
||||||
|
return exitCode;
|
||||||
|
}
|
||||||
return await super.run();
|
return await super.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,6 +15,8 @@ Future<int> _runPub(Directory directory, { bool upgrade: false }) async {
|
|||||||
for (FileSystemEntity dir in directory.listSync()) {
|
for (FileSystemEntity dir in directory.listSync()) {
|
||||||
if (dir is Directory && FileSystemEntity.isFileSync(dir.path + Platform.pathSeparator + 'pubspec.yaml')) {
|
if (dir is Directory && FileSystemEntity.isFileSync(dir.path + Platform.pathSeparator + 'pubspec.yaml')) {
|
||||||
updateCount++;
|
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);
|
await pubGet(directory: dir.path, upgrade: upgrade, checkLastModified: false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user