1 | 'use strict';
|
2 | const notifier = require('update-notifier');
|
3 | const pkg = require('../package.json');
|
4 | const FUN_DISABLE_VERSION_CHECK = 'FUN_DISABLE_VERSION_CHECK';
|
5 | function notify(updateCheckInterval = 1000 * 60 * 30) {
|
6 | const disableVersionCheck = process.env[FUN_DISABLE_VERSION_CHECK];
|
7 | if (disableVersionCheck !== undefined &&
|
8 | disableVersionCheck !== '0' &&
|
9 | disableVersionCheck !== 'false') {
|
10 | return;
|
11 | }
|
12 | notifier({
|
13 | pkg,
|
14 | updateCheckInterval
|
15 | }).notify();
|
16 | }
|
17 | module.exports = { notify };
|