@@ -71,6 +71,7 @@ function createChildProcessResults(childProcessResult: IChildProcessResults): ID
71
71
"xcodebuild -version" : childProcessResult . xCodeVersion ,
72
72
"pod --version" : childProcessResult . podVersion ,
73
73
"pod" : childProcessResult . pod ,
74
+ 'adb' : childProcessResult . adbVersion ,
74
75
'adb version' : childProcessResult . adbVersion ,
75
76
"'adb' version" : childProcessResult . adbVersion , // for Mac and Linux
76
77
'android' : childProcessResult . androidInstalled ,
@@ -83,9 +84,13 @@ function createChildProcessResults(childProcessResult: IChildProcessResults): ID
83
84
} ;
84
85
}
85
86
86
- function getResultFromChildProcess ( childProcessResultDescription : IChildProcessResultDescription , command : string ) : any {
87
+ function getResultFromChildProcess ( childProcessResultDescription : IChildProcessResultDescription , command : string , options ?: ISpawnFromEventOptions ) : any {
87
88
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
+ }
89
94
}
90
95
91
96
return childProcessResultDescription . result ;
@@ -111,8 +116,8 @@ function mockSysInfo(childProcessResult: IChildProcessResults, hostInfoOptions?:
111
116
exec : async ( command : string ) => {
112
117
return getResultFromChildProcess ( childProcessResultDictionary [ command ] , command ) ;
113
118
} ,
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 ) ;
116
121
} ,
117
122
execFile : async ( ) => {
118
123
return undefined ;
0 commit comments