[flutter_tools] add flutterRoot field to JSON machine output (#62053)

This commit is contained in:
Jonah Williams
2020-07-29 08:16:04 -07:00
committed by GitHub
parent d053a4d00a
commit f707f6f6ea
2 changed files with 24 additions and 1 deletions

View File

@@ -317,7 +317,11 @@ class FlutterCommandRunner extends CommandRunner<void> {
globals.flutterVersion.fetchTagsAndUpdate();
String status;
if (machineFlag) {
status = const JsonEncoder.withIndent(' ').convert(globals.flutterVersion.toJson());
final Map<String, Object> jsonOut = globals.flutterVersion.toJson();
if (jsonOut != null) {
jsonOut['flutterRoot'] = Cache.flutterRoot;
}
status = const JsonEncoder.withIndent(' ').convert(jsonOut);
} else {
status = globals.flutterVersion.toString();
}