Skip to content

Commit 2a28f1b

Browse files
authored
Merge pull request #2 from recurx/master
Overly eager react-devtools
2 parents 928a819 + 8e1db1a commit 2a28f1b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

packages/react-devtools/bin.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,19 @@ const argv = process.argv.slice(2);
1515
const pkg = require('./package.json');
1616
const updateNotifier = require('update-notifier');
1717

18-
// notify if there's an update
19-
updateNotifier({pkg}).notify({defer: false});
18+
// Notify if there's an update in 7 days' interval
19+
const notifier = updateNotifier({
20+
pkg,
21+
updateCheckInterval: 1000 * 60 * 60 * 24 * 7,
22+
});
23+
24+
if (notifier.update) {
25+
const updateMsg =
26+
`Update available ${notifier.update.current} -> ${notifier.update.latest}` +
27+
'\nTo update:' +
28+
'\n"npm i [-g] react-devtools" or "yarn add react-devtools"';
29+
notifier.notify({defer: false, message: updateMsg});
30+
}
2031

2132
const result = spawn.sync(electron, [require.resolve('./app')].concat(argv), {
2233
stdio: 'ignore',

0 commit comments

Comments
 (0)