Add mirror overrides to doctor output (#56928)

This commit is contained in:
Jenn Magder
2020-05-11 11:57:02 -07:00
committed by GitHub
parent 9c87b32477
commit 4ecb1bbe2d
3 changed files with 27 additions and 0 deletions

View File

@@ -22,6 +22,8 @@ class UserMessages {
'Framework revision $revision ($age), $date';
String engineRevision(String revision) => 'Engine revision $revision';
String dartRevision(String revision) => 'Dart version $revision';
String pubMirrorURL(String url) => 'Pub download mirror $url';
String flutterMirrorURL(String url) => 'Flutter download mirror $url';
String get flutterBinariesDoNotRun =>
'Downloaded executables cannot execute on host.\n'
'See https://github.com/flutter/flutter/issues/6207 for more information';

View File

@@ -642,6 +642,12 @@ class FlutterValidator extends DoctorValidator {
)));
messages.add(ValidationMessage(userMessages.engineRevision(version.engineRevisionShort)));
messages.add(ValidationMessage(userMessages.dartRevision(version.dartSdkVersion)));
if (globals.platform.environment.containsKey('PUB_HOSTED_URL')) {
messages.add(ValidationMessage(userMessages.pubMirrorURL(globals.platform.environment['PUB_HOSTED_URL'])));
}
if (globals.platform.environment.containsKey('FLUTTER_STORAGE_BASE_URL')) {
messages.add(ValidationMessage(userMessages.flutterMirrorURL(globals.platform.environment['FLUTTER_STORAGE_BASE_URL'])));
}
} on VersionCheckError catch (e) {
messages.add(ValidationMessage.error(e.message));
valid = ValidationType.partial;