mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Overly eager update-notifier usage in react-devtools (#20078)
Co-authored-by: abhyuday <abhyuday@miqdigital.com>
This commit is contained in:
15
packages/react-devtools/bin.js
vendored
15
packages/react-devtools/bin.js
vendored
@@ -15,8 +15,19 @@ const argv = process.argv.slice(2);
|
||||
const pkg = require('./package.json');
|
||||
const updateNotifier = require('update-notifier');
|
||||
|
||||
// notify if there's an update
|
||||
updateNotifier({pkg}).notify({defer: false});
|
||||
// Notify if there's an update in 7 days' interval
|
||||
const notifier = updateNotifier({
|
||||
pkg,
|
||||
updateCheckInterval: 1000 * 60 * 60 * 24 * 7,
|
||||
});
|
||||
|
||||
if (notifier.update) {
|
||||
const updateMsg =
|
||||
`Update available ${notifier.update.current} -> ${notifier.update.latest}` +
|
||||
'\nTo update:' +
|
||||
'\n"npm i [-g] react-devtools" or "yarn add react-devtools"';
|
||||
notifier.notify({defer: false, message: updateMsg});
|
||||
}
|
||||
|
||||
const result = spawn.sync(electron, [require.resolve('./app')].concat(argv), {
|
||||
stdio: 'ignore',
|
||||
|
||||
Reference in New Issue
Block a user