Update packages.js

This commit is contained in:
baozhoutao 2021-12-06 10:32:32 +08:00
parent 801ef83b38
commit b81f8dc169

View File

@ -8,10 +8,14 @@ const _ = require('lodash');
const login = require('./login');
function registryUrl(scope) {
const result = login.getYarnrcScopes();
const url = result[`${scope}:registry`];
if (url) {
return url.slice(-1) === '/' ? url : `${url}/`;
try {
const result = login.getYarnrcScopes();
const url = result[`${scope}:registry`];
if (url) {
return url.slice(-1) === '/' ? url : `${url}/`;
}
} catch (Exception) {
}
}