@@ -71,6 +71,7 @@ function createChildProcessResults(childProcessResult: IChildProcessResults): ID
7171 "xcodebuild -version" : childProcessResult . xCodeVersion ,
7272 "pod --version" : childProcessResult . podVersion ,
7373 "pod" : childProcessResult . pod ,
74+ 'adb' : childProcessResult . adbVersion ,
7475 'adb version' : childProcessResult . adbVersion ,
7576 "'adb' version" : childProcessResult . adbVersion , // for Mac and Linux
7677 'android' : childProcessResult . androidInstalled ,
@@ -83,9 +84,13 @@ function createChildProcessResults(childProcessResult: IChildProcessResults): ID
8384 } ;
8485}
8586
86- function getResultFromChildProcess ( childProcessResultDescription : IChildProcessResultDescription , command : string ) : any {
87+ function getResultFromChildProcess ( childProcessResultDescription : IChildProcessResultDescription , command : string , options ?: ISpawnFromEventOptions ) : any {
8788 if ( childProcessResultDescription . shouldThrowError ) {
88- throw new Error ( `This one throws error. (${ command } )` ) ;
89+ if ( options && options . ignoreError ) {
90+ return null ;
91+ } else {
92+ throw new Error ( `This one throws error. (${ command } )` ) ;
93+ }
8994 }
9095
9196 return childProcessResultDescription . result ;
@@ -111,8 +116,8 @@ function mockSysInfo(childProcessResult: IChildProcessResults, hostInfoOptions?:
111116 exec : async ( command : string ) => {
112117 return getResultFromChildProcess ( childProcessResultDictionary [ command ] , command ) ;
113118 } ,
114- spawnFromEvent : async ( command : string , args : string [ ] , event : string ) => {
115- return getResultFromChildProcess ( childProcessResultDictionary [ command ] , command ) ;
119+ spawnFromEvent : async ( command : string , args : string [ ] , event : string , options : ISpawnFromEventOptions ) => {
120+ return getResultFromChildProcess ( childProcessResultDictionary [ command ] , command , options ) ;
116121 } ,
117122 execFile : async ( ) => {
118123 return undefined ;
0 commit comments