Avoid downloading artifacts twice (#8872)
* Avoid downloading artifacts twice * Don't update cache before `flutter upgrade` is executed (`flutter upgrade` might bump the engine version) * Don't update cache twice during `flutter precache` Fixes #8249. * add test
This commit is contained in:
committed by
GitHub
parent
269538df58
commit
d35a9db6fe
@@ -37,6 +37,8 @@ abstract class FlutterCommand extends Command<Null> {
|
||||
|
||||
bool get shouldRunPub => _usesPubOption && argResults['pub'];
|
||||
|
||||
bool get shouldUpdateCache => true;
|
||||
|
||||
BuildMode _defaultBuildMode;
|
||||
|
||||
void usesTargetOption() {
|
||||
@@ -134,7 +136,8 @@ abstract class FlutterCommand extends Command<Null> {
|
||||
Future<Null> verifyThenRunCommand() async {
|
||||
// Populate the cache. We call this before pub get below so that the sky_engine
|
||||
// package is available in the flutter cache for pub to find.
|
||||
await cache.updateAll();
|
||||
if (shouldUpdateCache)
|
||||
await cache.updateAll();
|
||||
|
||||
if (shouldRunPub)
|
||||
await pubGet();
|
||||
|
||||
Reference in New Issue
Block a user