@@ -8,7 +8,8 @@ let clui = require("clui");
8
8
class DoctorService implements IDoctorService {
9
9
private static MIN_SUPPORTED_POD_VERSION = "0.38.2" ;
10
10
11
- constructor ( private $androidToolsInfo : IAndroidToolsInfo ,
11
+ constructor ( private $analyticsService : IAnalyticsService ,
12
+ private $androidToolsInfo : IAndroidToolsInfo ,
12
13
private $hostInfo : IHostInfo ,
13
14
private $logger : ILogger ,
14
15
private $progressIndicator : IProgressIndicator ,
@@ -18,7 +19,7 @@ class DoctorService implements IDoctorService {
18
19
private $npm : INodePackageManager ,
19
20
private $fs : IFileSystem ) { }
20
21
21
- public printWarnings ( ) : boolean {
22
+ public printWarnings ( configOptions ?: { trackResult : boolean } ) : boolean {
22
23
let result = false ;
23
24
let sysInfo = this . $sysInfo . getSysInfo ( path . join ( __dirname , ".." , ".." , "package.json" ) ) . wait ( ) ;
24
25
@@ -88,7 +89,14 @@ class DoctorService implements IDoctorService {
88
89
89
90
let androidToolsIssues = this . $androidToolsInfo . validateInfo ( ) . wait ( ) ;
90
91
let javaVersionIssue = this . $androidToolsInfo . validateJava ( sysInfo . javacVersion ) . wait ( ) ;
91
- return result || androidToolsIssues || javaVersionIssue ;
92
+
93
+ let doctorResult = result || androidToolsIssues || javaVersionIssue ;
94
+
95
+ if ( ! configOptions || configOptions . trackResult ) {
96
+ this . $analyticsService . track ( "DoctorEnvironmentSetup" , doctorResult ? "incorrect" : "correct" ) . wait ( ) ;
97
+ }
98
+
99
+ return doctorResult ;
92
100
}
93
101
94
102
private printPackageManagerTip ( ) {
0 commit comments