@@ -18,7 +18,6 @@ const archiver = require("../helpers/archiver"),
18
18
{ initTimeComponents, instrumentEventTime, markBlockStart, markBlockEnd, getTimeComponents} = require ( '../helpers/timeComponents' ) ,
19
19
downloadBuildArtifacts = require ( '../helpers/buildArtifacts' ) . downloadBuildArtifacts ,
20
20
downloadBuildStacktrace = require ( '../helpers/downloadBuildStacktrace' ) . downloadBuildStacktrace ,
21
- updateNotifier = require ( 'update-notifier' ) ,
22
21
pkg = require ( '../../package.json' ) ,
23
22
packageDiff = require ( '../helpers/package-diff' ) ;
24
23
const { getStackTraceUrl } = require ( '../helpers/sync/syncSpecsLogs' ) ;
@@ -531,23 +530,27 @@ module.exports = function run(args, rawArgs) {
531
530
utils . sendUsageReport ( bsJsonData , args , err . message , Constants . messageTypes . ERROR , utils . getErrorCodeFromErr ( err ) , null , rawArgs ) ;
532
531
process . exitCode = Constants . ERROR_EXIT_CODE ;
533
532
} ) . finally ( function ( ) {
534
- const notifier = updateNotifier ( {
535
- pkg,
536
- updateCheckInterval : 1000 * 60 * 60 * 24 * 7 ,
537
- } ) ;
533
+ import ( 'update-notifier' ) . then ( ( { default : updateNotifier } ) => {
534
+ const notifier = updateNotifier ( {
535
+ pkg,
536
+ updateCheckInterval : 1000 * 60 * 60 * 24 * 7 ,
537
+ } ) ;
538
538
539
- // Checks for update on first run.
540
- // Set lastUpdateCheck to 0 to spawn the check update process as notifier sets this to Date.now() for preventing
541
- // the check untill one interval period. It runs once.
542
- if ( ! notifier . disabled && Date . now ( ) - notifier . config . get ( 'lastUpdateCheck' ) < 50 ) {
543
- notifier . config . set ( 'lastUpdateCheck' , 0 ) ;
544
- notifier . check ( ) ;
545
- }
539
+ // Checks for update on first run.
540
+ // Set lastUpdateCheck to 0 to spawn the check update process as notifier sets this to Date.now() for preventing
541
+ // the check untill one interval period. It runs once.
542
+ if ( ! notifier . disabled && Date . now ( ) - notifier . config . get ( 'lastUpdateCheck' ) < 50 ) {
543
+ notifier . config . set ( 'lastUpdateCheck' , 0 ) ;
544
+ notifier . check ( ) ;
545
+ }
546
546
547
- // Set the config update as notifier clears this after reading.
548
- if ( notifier . update && notifier . update . current !== notifier . update . latest ) {
549
- notifier . config . set ( 'update' , notifier . update ) ;
550
- notifier . notify ( { isGlobal : true } ) ;
551
- }
547
+ // Set the config update as notifier clears this after reading.
548
+ if ( notifier . update && notifier . update . current !== notifier . update . latest ) {
549
+ notifier . config . set ( 'update' , notifier . update ) ;
550
+ notifier . notify ( { isGlobal : true } ) ;
551
+ }
552
+ } ) . catch ( ( error ) => {
553
+ logger . debug ( 'Got error loading update-notifier: ' , error ) ;
554
+ } ) ;
552
555
} ) ;
553
556
}
0 commit comments