@@ -31,7 +31,7 @@ export class Integration extends BaseIntegration {
3131
3232 const info : InfoItem [ ] = [
3333 { group : 'cordova' , key : 'cordova' , flair : 'Cordova CLI' , value : cordovaVersion || 'not installed' } ,
34- { group : 'cordova' , key : 'Cordova Platforms' , value : cordovaPlatforms || 'none' } ,
34+ { group : 'cordova' , key : 'Cordova Platforms' , value : cordovaPlatforms } ,
3535 ] ;
3636
3737 if ( xcode ) {
@@ -71,19 +71,24 @@ export class Integration extends BaseIntegration {
7171 return this . shell . cmdinfo ( 'cordova' , [ '-v' , '--no-telemetry' ] ) ;
7272 }
7373
74- async getCordovaPlatformVersions ( ) : Promise < string | undefined > {
74+ async getCordovaPlatformVersions ( ) : Promise < string > {
7575 try {
7676 const output = await this . shell . output ( 'cordova' , [ 'platform' , 'ls' , '--no-telemetry' ] , { showCommand : false } ) ;
77-
78- return output
77+ const platforms = output
7978 . replace ( 'Installed platforms:' , '' )
8079 . replace ( / A v a i l a b l e p l a t f o r m s [ \s \S ] + / , '' )
8180 . split ( '\n' )
8281 . map ( l => l . trim ( ) )
83- . filter ( l => l && ! l . startsWith ( '.' ) )
84- . join ( ', ' ) ;
82+ . filter ( l => l && ! l . startsWith ( '.' ) ) ;
83+
84+ if ( platforms . length === 0 ) {
85+ return 'none' ;
86+ }
87+
88+ return platforms . join ( ', ' ) ;
8589 } catch ( e ) {
8690 debug ( 'Error while getting Cordova platforms: %o' , e ) ;
91+ return 'not available' ;
8792 }
8893 }
8994
0 commit comments