Handle trying to upgrade Flutter with no upstream

Fixes #1084
This commit is contained in:
Adam Barth
2016-01-07 10:25:38 -08:00
parent e3668470c7
commit 2303188614

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);