@@ -24,7 +24,7 @@ export function getAppScriptsPackageJson() {
2424  return  cachedAppScriptsPackageJson ; 
2525} 
2626
27- export  function  getAppScriptsVersion ( )  { 
27+ export  function  getAppScriptsVersion ( ) :  string  { 
2828  const  appScriptsPackageJson  =  getAppScriptsPackageJson ( ) ; 
2929  return  ( appScriptsPackageJson  &&  appScriptsPackageJson . version )  ? appScriptsPackageJson . version  : '' ; 
3030} 
@@ -36,38 +36,48 @@ function getUserPackageJson(userRootDir: string) {
3636  return  null ; 
3737} 
3838
39- export  function  getSystemInfo ( userRootDir : string )  { 
39+ export  function  getSystemText ( userRootDir : string )  { 
40+   const  systemData  =  getSystemData ( userRootDir ) ; 
4041  const  d : string [ ]  =  [ ] ; 
4142
42-   let  ionicAppScripts  =  getAppScriptsVersion ( ) ; 
43-   let  ionicFramework : string  =  null ; 
44-   let  ionicNative : string  =  null ; 
45-   let  angularCore : string  =  null ; 
46-   let  angularCompilerCli : string  =  null ; 
43+   d . push ( `Ionic Framework: ${ systemData . ionicFramework }  ` ) ; 
44+   if  ( systemData . ionicNative )  { 
45+     d . push ( `Ionic Native: ${ systemData . ionicNative }  ` ) ; 
46+   } 
47+   d . push ( `Ionic App Scripts: ${ systemData . ionicAppScripts }  ` ) ; 
48+   d . push ( `Angular Core: ${ systemData . angularCore }  ` ) ; 
49+   d . push ( `Angular Compiler CLI: ${ systemData . angularCompilerCli }  ` ) ; 
50+   d . push ( `Node: ${ systemData . node }  ` ) ; 
51+   d . push ( `OS Platform: ${ systemData . osName }  ` ) ; 
52+ 
53+   return  d ; 
54+ } 
55+ 
56+ 
57+ export  function  getSystemData ( userRootDir : string )  { 
58+   const  d  =  { 
59+     ionicAppScripts : getAppScriptsVersion ( ) , 
60+     ionicFramework : '' , 
61+     ionicNative : '' , 
62+     angularCore : '' , 
63+     angularCompilerCli : '' , 
64+     node : process . version . replace ( 'v' ,  '' ) , 
65+     osName : osName ( ) 
66+   } ; 
4767
4868  try  { 
4969    const  userPackageJson  =  getUserPackageJson ( userRootDir ) ; 
5070    if  ( userPackageJson )  { 
5171      const  userDependencies  =  userPackageJson . dependencies ; 
5272      if  ( userDependencies )  { 
53-         ionicFramework  =  userDependencies [ 'ionic-angular' ] ; 
54-         ionicNative  =  userDependencies [ 'ionic-native' ] ; 
55-         angularCore  =  userDependencies [ '@angular/core' ] ; 
56-         angularCompilerCli  =  userDependencies [ '@angular/compiler-cli' ] ; 
73+         d . ionicFramework  =  userDependencies [ 'ionic-angular' ] ; 
74+         d . ionicNative  =  userDependencies [ 'ionic-native' ] ; 
75+         d . angularCore  =  userDependencies [ '@angular/core' ] ; 
76+         d . angularCompilerCli  =  userDependencies [ '@angular/compiler-cli' ] ; 
5777      } 
5878    } 
5979  }  catch  ( e )  { } 
6080
61-   d . push ( `Ionic Framework: ${ ionicFramework }  ` ) ; 
62-   if  ( ionicNative )  { 
63-     d . push ( `Ionic Native: ${ ionicNative }  ` ) ; 
64-   } 
65-   d . push ( `Ionic App Scripts: ${ ionicAppScripts }  ` ) ; 
66-   d . push ( `Angular Core: ${ angularCore }  ` ) ; 
67-   d . push ( `Angular Compiler CLI: ${ angularCompilerCli }  ` ) ; 
68-   d . push ( `Node: ${ process . version . replace ( 'v' ,  '' ) }  ` ) ; 
69-   d . push ( `OS Platform: ${ osName ( ) }  ` ) ; 
70- 
7181  return  d ; 
7282} 
7383
@@ -135,7 +145,7 @@ export function readAndCacheFile(filePath: string, purge: boolean = false): Prom
135145  } ) ; 
136146} 
137147
138- export  function  unlinkAsync ( filePath : string | string [ ] )  { 
148+ export  function  unlinkAsync ( filePath : string | string [ ] ) :  Promise < any >  { 
139149  let  filePaths : string [ ] ; 
140150
141151  if  ( typeof  filePath  ===  'string' )  { 
0 commit comments