Skip to content

Commit e4153f2

Browse files
committed
chore: bump the version of update-notifier
1 parent 7371302 commit e4153f2

File tree

2 files changed

+21
-19
lines changed

2 files changed

+21
-19
lines changed

bin/commands/runs.js

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ const archiver = require("../helpers/archiver"),
1818
{initTimeComponents, instrumentEventTime, markBlockStart, markBlockEnd, getTimeComponents} = require('../helpers/timeComponents'),
1919
downloadBuildArtifacts = require('../helpers/buildArtifacts').downloadBuildArtifacts,
2020
downloadBuildStacktrace = require('../helpers/downloadBuildStacktrace').downloadBuildStacktrace,
21-
updateNotifier = require('update-notifier'),
2221
pkg = require('../../package.json'),
2322
packageDiff = require('../helpers/package-diff');
2423
const { getStackTraceUrl } = require('../helpers/sync/syncSpecsLogs');
@@ -531,23 +530,26 @@ module.exports = function run(args, rawArgs) {
531530
utils.sendUsageReport(bsJsonData, args, err.message, Constants.messageTypes.ERROR, utils.getErrorCodeFromErr(err), null, rawArgs);
532531
process.exitCode = Constants.ERROR_EXIT_CODE;
533532
}).finally(function(){
534-
const notifier = updateNotifier({
535-
pkg,
536-
updateCheckInterval: 1000 * 60 * 60 * 24 * 7,
537-
});
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-
}
533+
import('update-notifier').then(({ default: updateNotifier } ) => {
534+
const notifier = updateNotifier({
535+
pkg,
536+
updateCheckInterval: 1000 * 60 * 60 * 24 * 7,
537+
});
538+
// Checks for update on first run.
539+
// Set lastUpdateCheck to 0 to spawn the check update process as notifier sets this to Date.now() for preventing
540+
// the check untill one interval period. It runs once.
541+
if (!notifier.disabled && Date.now() - notifier.config.get('lastUpdateCheck') < 50) {
542+
notifier.config.set('lastUpdateCheck', 0);
543+
notifier.check();
544+
}
546545

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-
}
546+
// Set the config update as notifier clears this after reading.
547+
if (notifier.update && notifier.update.current !== notifier.update.latest) {
548+
notifier.config.set('update', notifier.update);
549+
notifier.notify({isGlobal: true});
550+
}
551+
}).catch((error) => {
552+
logger.debug('Got error loading update-notifier: ', error);
553+
});
552554
});
553555
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"request": "2.88.2",
3030
"requestretry": "7.1.0",
3131
"table": "5.4.6",
32-
"update-notifier": "5.1.0",
32+
"update-notifier": "7.0.0",
3333
"uuid": "8.3.2",
3434
"windows-release": "^5.1.0",
3535
"winston": "2.4.4",

0 commit comments

Comments
 (0)