Commit 1878c624 authored by Devon Carew's avatar Devon Carew

Merge pull request #2864 from devoncarew/doctor_os

print the os from flutter doctor
parents d7e4f78b d4185802
...@@ -14,6 +14,18 @@ import 'globals.dart'; ...@@ -14,6 +14,18 @@ import 'globals.dart';
import 'ios/ios_workflow.dart'; import 'ios/ios_workflow.dart';
import 'runner/version.dart'; import 'runner/version.dart';
const Map<String, String> _osNames = const <String, String>{
'macos': 'Mac OS',
'linux': 'Linux',
'windows': 'Windows'
};
String osName() {
String os = Platform.operatingSystem;
return _osNames.containsKey(os) ? _osNames[os] : os;
}
class Doctor { class Doctor {
Doctor() { Doctor() {
_validators.add(new _FlutterValidator()); _validators.add(new _FlutterValidator());
...@@ -179,11 +191,10 @@ class _FlutterValidator extends DoctorValidator { ...@@ -179,11 +191,10 @@ class _FlutterValidator extends DoctorValidator {
messages.add(new ValidationMessage('Flutter root at ${version.flutterRoot}')); messages.add(new ValidationMessage('Flutter root at ${version.flutterRoot}'));
messages.add(new ValidationMessage('Framework revision ${version.frameworkRevisionShort} ' messages.add(new ValidationMessage('Framework revision ${version.frameworkRevisionShort} '
'(${version.frameworkAge})')); '(${version.frameworkAge}, channel ${version.channel})'));
messages.add(new ValidationMessage('Engine revision ${version.engineRevisionShort}')); messages.add(new ValidationMessage('Engine revision ${version.engineRevisionShort}'));
return new ValidationResult(ValidationType.installed, messages, return new ValidationResult(ValidationType.installed, messages, statusInfo: osName());
statusInfo: '${version.frameworkRevisionShort} - channel ${version.channel}');
} }
} }
......
...@@ -49,8 +49,8 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -49,8 +49,8 @@ class FlutterCommandRunner extends CommandRunner {
hide: !verboseHelp, hide: !verboseHelp,
help: 'Path to your packages directory.$packagesHelp'); help: 'Path to your packages directory.$packagesHelp');
argParser.addOption('flutter-root', argParser.addOption('flutter-root',
help: 'The root directory of the Flutter repository. Uses \$$kFlutterRootEnvironmentVariableName if set,\n' help: 'The root directory of the Flutter repository (uses \$$kFlutterRootEnvironmentVariableName if set).',
'otherwise defaults to a value derived from the location of this tool.', defaultsTo: _defaultFlutterRoot); defaultsTo: _defaultFlutterRoot);
if (verboseHelp) if (verboseHelp)
argParser.addSeparator('Local build selection options (not normally required):'); argParser.addSeparator('Local build selection options (not normally required):');
...@@ -126,9 +126,7 @@ class FlutterCommandRunner extends CommandRunner { ...@@ -126,9 +126,7 @@ class FlutterCommandRunner extends CommandRunner {
@override @override
String get usageFooter { String get usageFooter {
return 'Run "flutter -h -v" for verbose help output, including less commonly used options.\n' return 'Run "flutter -h -v" for verbose help output, including less commonly used options.';
'\n'
'${doctor.summaryText}';
} }
List<BuildConfiguration> get buildConfigurations { List<BuildConfiguration> get buildConfigurations {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment