@@ -147,12 +147,10 @@ export class AnalyticsService implements IAnalyticsService, IDisposable {
147
147
@cache ( )
148
148
private getAnalyticsBroker ( ) : Promise < ChildProcess > {
149
149
return new Promise < ChildProcess > ( ( resolve , reject ) => {
150
+ const brokerProcessArgs = this . getBrokerProcessArgs ( ) ;
151
+
150
152
const broker = this . $childProcess . spawn ( process . execPath ,
151
- [
152
- path . join ( __dirname , "analytics-broker-process.js" ) ,
153
- this . $staticConfig . PATH_TO_BOOTSTRAP ,
154
- this . $options . analyticsLogFile // TODO: Check if passing path with space or quotes will work
155
- ] ,
153
+ brokerProcessArgs ,
156
154
{
157
155
stdio : [ "ignore" , "ignore" , "ignore" , "ipc" ] ,
158
156
detached : true
@@ -200,6 +198,19 @@ export class AnalyticsService implements IAnalyticsService, IDisposable {
200
198
} ) ;
201
199
}
202
200
201
+ private getBrokerProcessArgs ( ) : string [ ] {
202
+ const brokerProcessArgs = [
203
+ path . join ( __dirname , "analytics-broker-process.js" ) ,
204
+ this . $staticConfig . PATH_TO_BOOTSTRAP ,
205
+ ] ;
206
+
207
+ if ( this . $options . analyticsLogFile ) {
208
+ brokerProcessArgs . push ( this . $options . analyticsLogFile ) ;
209
+ }
210
+
211
+ return brokerProcessArgs ;
212
+ }
213
+
203
214
private async sendInfoForTracking ( trackingInfo : ITrackingInformation , settingName : string ) : Promise < void > {
204
215
await this . initAnalyticsStatuses ( ) ;
205
216
0 commit comments