@@ -20,7 +20,7 @@ class DoctorService implements IDoctorService {
20
20
private $terminalSpinnerService : ITerminalSpinnerService ,
21
21
private $versionsService : IVersionsService ) { }
22
22
23
- public async printWarnings ( configOptions ?: { trackResult : boolean } ) : Promise < boolean > {
23
+ public async printWarnings ( configOptions ?: { trackResult : boolean } ) : Promise < void > {
24
24
const infos = await this . $terminalSpinnerService . execute < NativeScriptDoctor . IInfo [ ] > ( {
25
25
text : `Getting environment information ${ EOL } `
26
26
} , ( ) => doctor . getInfos ( ) ) ;
@@ -42,15 +42,15 @@ class DoctorService implements IDoctorService {
42
42
if ( hasWarnings ) {
43
43
this . $logger . info ( "There seem to be issues with your configuration." ) ;
44
44
await this . promptForHelp ( ) ;
45
+ } else {
46
+ this . $logger . out ( "No issues were detected." . bold ) ;
45
47
}
46
48
47
49
try {
48
50
await this . $versionsService . checkComponentsForUpdate ( ) ;
49
51
} catch ( err ) {
50
52
this . $logger . error ( "Cannot get the latest versions information from npm. Please try again later." ) ;
51
53
}
52
-
53
- return hasWarnings ;
54
54
}
55
55
56
56
public runSetupScript ( ) : Promise < ISpawnResult > {
@@ -70,10 +70,8 @@ class DoctorService implements IDoctorService {
70
70
}
71
71
72
72
public async canExecuteLocalBuild ( platform ?: string ) : Promise < boolean > {
73
- let infos = await doctor . getInfos ( ) ;
74
- if ( platform ) {
75
- infos = this . filterInfosByPlatform ( infos , platform ) ;
76
- }
73
+ const infos = await doctor . getInfos ( { platform } ) ;
74
+ this . printInfosCore ( infos ) ;
77
75
78
76
const warnings = this . filterInfosByType ( infos , constants . WARNING_TYPE_NAME ) ;
79
77
if ( warnings . length > 0 ) {
@@ -149,10 +147,6 @@ class DoctorService implements IDoctorService {
149
147
} ) ;
150
148
}
151
149
152
- private filterInfosByPlatform ( infos : NativeScriptDoctor . IInfo [ ] , platform : string ) : NativeScriptDoctor . IInfo [ ] {
153
- return infos . filter ( info => _ . includes ( info . platforms , platform ) ) ;
154
- }
155
-
156
150
private filterInfosByType ( infos : NativeScriptDoctor . IInfo [ ] , type : string ) : NativeScriptDoctor . IInfo [ ] {
157
151
return infos . filter ( info => info . type === type ) ;
158
152
}
0 commit comments