Teach flutter upgrade to switch to master (#5827)

To avoid orphaning people on the deprecated alpha branch, this patch teaches
`flutter upgrade` to switch to the master branch.
This commit is contained in:
Adam Barth
2016-09-12 13:25:57 -07:00
committed by GitHub
parent e2070ba317
commit 4ea8f302ab

View File

@@ -33,6 +33,14 @@ class UpgradeCommand extends FlutterCommand {
return 1;
}
FlutterVersion version = new FlutterVersion(Cache.flutterRoot);
if (version.channel == 'alpha') {
// The alpha branch is deprecated. Rather than trying to pull the alpha
// branch, we should switch upstream to master.
printStatus('Switching to from alpha to master...');
runSync(<String>['git', 'branch', '--set-upstream-to=origin/master']);
}
printStatus('Upgrading Flutter from ${Cache.flutterRoot}...');
int code = await runCommandAndStreamOutput(