MCPcopy
hub / github.com/vercel/hyper / checkUpdate

Method checkUpdate

bin/yarn-standalone.js:7394–7419  ·  view source on GitHub ↗

* Check for updates every day and output a nag message if there's a newer version.

()

Source from the content-addressed store, hash-verified

7392 */
7393
7394 checkUpdate() {
7395 if (this.config.nonInteractive) {
7396 // don't show upgrade dialog on CI or non-TTY terminals
7397 return;
7398 }
7399
7400 // don't check if disabled
7401 if (this.config.getOption('disable-self-update-check')) {
7402 return;
7403 }
7404
7405 // only check for updates once a day
7406 const lastUpdateCheck = Number(this.config.getOption('lastUpdateCheck')) || 0;
7407 if (lastUpdateCheck && Date.now() - lastUpdateCheck < ONE_DAY) {
7408 return;
7409 }
7410
7411 // don't bug for updates on tagged releases
7412 if ((_yarnVersion || _load_yarnVersion()).version.indexOf('-') >= 0) {
7413 return;
7414 }
7415
7416 this._checkUpdate().catch(() => {
7417 // swallow errors
7418 });
7419 }
7420
7421 _checkUpdate() {
7422 var _this13 = this;

Callers 1

initMethod · 0.80

Calls 4

_checkUpdateMethod · 0.95
_load_yarnVersionFunction · 0.85
indexOfMethod · 0.80
getOptionMethod · 0.45

Tested by

no test coverage detected