1 |
|
2 | 'use strict';
|
3 | let updateNotifier = require('.');
|
4 |
|
5 | const options = JSON.parse(process.argv[2]);
|
6 |
|
7 | updateNotifier = new updateNotifier.UpdateNotifier(options);
|
8 |
|
9 | (async () => {
|
10 |
|
11 | setTimeout(process.exit, 1000 * 30);
|
12 |
|
13 | const update = await updateNotifier.fetchInfo();
|
14 |
|
15 |
|
16 | updateNotifier.config.set('lastUpdateCheck', Date.now());
|
17 |
|
18 | if (update.type && update.type !== 'latest') {
|
19 | updateNotifier.config.set('update', update);
|
20 | }
|
21 |
|
22 |
|
23 |
|
24 | process.exit();
|
25 | })().catch(error => {
|
26 | console.error(error);
|
27 | process.exit(1);
|
28 | });
|