@@ -293,17 +293,21 @@ BrowserSync.prototype.getLogger = logger.getLogger;
293
293
* @param {* } value
294
294
* @returns {BrowserSync.options|* }
295
295
*/
296
- BrowserSync . prototype . setOption = function ( name , value ) {
296
+ BrowserSync . prototype . setOption = function ( name , value , silent ) {
297
297
this . debug ( "Setting Option: {cyan:%s} - {magenta:%s" , name , value . toString ( ) ) ;
298
298
this . options = this . options . set ( name , value ) ;
299
- this . events . emit ( "options:set" , { path : name , value : value , options : this . options } ) ;
299
+ if ( ! silent ) {
300
+ this . events . emit ( "options:set" , { path : name , value : value , options : this . options } ) ;
301
+ }
300
302
return this . options ;
301
303
} ;
302
304
303
- BrowserSync . prototype . setOptionIn = function ( path , value ) {
305
+ BrowserSync . prototype . setOptionIn = function ( path , value , silent ) {
304
306
this . debug ( "Setting Option: {cyan:%s} - {magenta:%s" , path . join ( "." ) , value . toString ( ) ) ;
305
307
this . options = this . options . setIn ( path , value ) ;
306
- this . events . emit ( "options:set" , { path : path , value : value , options : this . options } ) ;
308
+ if ( ! silent ) {
309
+ this . events . emit ( "options:set" , { path : path , value : value , options : this . options } ) ;
310
+ }
307
311
return this . options ;
308
312
} ;
309
313
@@ -312,10 +316,12 @@ BrowserSync.prototype.setOptionIn = function (path, value) {
312
316
* @param fn
313
317
* @returns {Map|* }
314
318
*/
315
- BrowserSync . prototype . setMany = function ( fn ) {
319
+ BrowserSync . prototype . setMany = function ( fn , silent ) {
316
320
this . debug ( "Setting multiple Options" ) ;
317
321
this . options = this . options . withMutations ( fn ) ;
318
- this . events . emit ( "options:set" , { options : this . options . toJS ( ) } ) ;
322
+ if ( ! silent ) {
323
+ this . events . emit ( "options:set" , { options : this . options . toJS ( ) } ) ;
324
+ }
319
325
return this . options ;
320
326
} ;
321
327
0 commit comments