MCPcopy
hub / github.com/lavas-project/lavas / requestPackageInfo

Function requestPackageInfo

packages/lavas-cli/src/lib/utils/checkUpdate.js:19–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

17const TIME_RANGE = 24 * 60 * 60 * 1000;
18
19async function requestPackageInfo() {
20 try {
21 let packageInfo = await axios({
22 url: LAVAS_NPM_REGISTRY,
23 timeout: 1000
24 });
25 let lastVersion = packageInfo.data['dist-tags'].latest;
26 let curVersion = require('../../../package.json').version;
27
28 if (semver.gt(lastVersion, curVersion)) {
29 log.info(log.chalk.bold.yellow(locals.UPDATE_TIPS));
30 }
31 }
32 catch (e) {}
33}
34
35/**
36 * 检测是否需要更新 Lavas 版本

Callers 1

checkUpdate.jsFile · 0.85

Calls 1

infoMethod · 0.80

Tested by

no test coverage detected