Commit bd15e8dd authored by Chris Bracken's avatar Chris Bracken Committed by GitHub

Emit macOS version information in doctor (#8772)

macOS counterpart to c670cd9e.
parent 859da8d2
......@@ -34,6 +34,14 @@ String osName() {
final ProcessResult result = processManager.runSync(<String>['ver'], runInShell: true);
if (result.exitCode == 0)
return result.stdout.trim();
} else if (platform.isMacOS) {
final List<ProcessResult> results = <ProcessResult>[
processManager.runSync(<String>["sw_vers", "-productName"]),
processManager.runSync(<String>["sw_vers", "-productVersion"]),
processManager.runSync(<String>["sw_vers", "-buildVersion"]),
];
if (results.every((ProcessResult result) => result.exitCode == 0))
return "${results[0].stdout.trim()} ${results[1].stdout.trim()} ${results[2].stdout.trim()}";
}
final String os = platform.operatingSystem;
return _osNames.containsKey(os) ? _osNames[os] : os;
......
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