Merge pull request #1116 from abarth/upgrade_with_no_upstream
Handle trying to upgrade Flutter with no upstream
This commit is contained in:
commit
4e9762784a
@ -14,7 +14,16 @@ class UpgradeCommand extends FlutterCommand {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<int> runInProject() async {
|
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'
|
'git', 'pull', '--ff-only'
|
||||||
], workingDirectory: ArtifactStore.flutterRoot);
|
], workingDirectory: ArtifactStore.flutterRoot);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user