@@ -147,12 +147,10 @@ export class AnalyticsService implements IAnalyticsService, IDisposable {
147147 @cache ( )
148148 private getAnalyticsBroker ( ) : Promise < ChildProcess > {
149149 return new Promise < ChildProcess > ( ( resolve , reject ) => {
150+ const brokerProcessArgs = this . getBrokerProcessArgs ( ) ;
151+
150152 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 ,
156154 {
157155 stdio : [ "ignore" , "ignore" , "ignore" , "ipc" ] ,
158156 detached : true
@@ -200,6 +198,19 @@ export class AnalyticsService implements IAnalyticsService, IDisposable {
200198 } ) ;
201199 }
202200
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+
203214 private async sendInfoForTracking ( trackingInfo : ITrackingInformation , settingName : string ) : Promise < void > {
204215 await this . initAnalyticsStatuses ( ) ;
205216
0 commit comments