From 3824e88df71099c3c35bbfeaf9afdbaa4c31a2ad Mon Sep 17 00:00:00 2001
From: Adam Barth <abarth@chromium.org>
Date: Mon, 28 Mar 2016 12:16:19 -0700
Subject: [PATCH] `flutter upgrade` needed twice if sky_services dependencies
 change

Now we run `flutter --version` to update our local cache of packages before
running `pub upgrade`, which reads from that cache.

Fixes #2953
---
 packages/flutter_tools/lib/src/commands/upgrade.dart | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/packages/flutter_tools/lib/src/commands/upgrade.dart b/packages/flutter_tools/lib/src/commands/upgrade.dart
index 76fab602fb..8e6f060040 100644
--- a/packages/flutter_tools/lib/src/commands/upgrade.dart
+++ b/packages/flutter_tools/lib/src/commands/upgrade.dart
@@ -43,6 +43,11 @@ class UpgradeCommand extends FlutterCommand {
     if (code != 0)
       return code;
 
+    // Causes us to update our locally cached packages.
+    code = await runCommandAndStreamOutput(<String>[
+      'bin/flutter', '--version'
+    ], workingDirectory: ArtifactStore.flutterRoot);
+
     printStatus('');
     code = await runCommandAndStreamOutput([sdkBinaryName('pub'), 'upgrade']);
 
-- 
2.21.0