.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / update-notifier / check.js
1 /* eslint-disable unicorn/no-process-exit */
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 updateNotifier.checkNpm().then(update => {
10         // Only update the last update check time on success
11         updateNotifier.config.set('lastUpdateCheck', Date.now());
12
13         if (update.type && update.type !== 'latest') {
14                 updateNotifier.config.set('update', update);
15         }
16
17         // Call process exit explicitly to terminate the child process
18         // Otherwise the child process will run forever, according to the Node.js docs
19         process.exit();
20 }).catch(() => {
21         process.exit(1);
22 });