Merge pull request #1116 from abarth/upgrade_with_no_upstream

Handle trying to upgrade Flutter with no upstream
This commit is contained in:
Adam Barth 2016-01-07 11:25:55 -08:00
commit 4e9762784a

View File

@ -14,7 +14,16 @@ class UpgradeCommand extends FlutterCommand {
@override
Future<int> runInProject() async {
int code = await runCommandAndStreamOutput([
try {
runCheckedSync(<String>[
'git', 'rev-parse', '@{u}'
], workingDirectory: ArtifactStore.flutterRoot);
} catch (e) {
print('Unable to upgrade Flutter. No upstream repository configured for Flutter.');
return 1;
}
int code = await runCommandAndStreamOutput(<String>[
'git', 'pull', '--ff-only'
], workingDirectory: ArtifactStore.flutterRoot);