Skip to content

Commit

Permalink
refactor: change conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed May 23, 2024
1 parent 122d38d commit 342bd84
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/hooks/diagnostics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ export const hook: HookFunction = (options) => Promise.all([registryCheck(option
const registryCheck = async (options: { doctor: SfDoctor }): Promise<void> => {
// find npm install
const npm = new NpmModule('');

const config = npm.run('config get registry').stdout.trim();
await Promise.all(
[
...new Set([
// npm and yarn registries
'https://registry.npmjs.org',
'https://registry.yarnpkg.com',
process.env.npm_config_registry ??
process.env.NPM_CONFIG_REGISTRY ??
npm.run('config get registry').stdout.trim() ??
'https://registry.npmjs.org',
process.env.NPM_CONFIG_REGISTRY ??
npm.run('config get registry').stdout.trim()
? config
: 'https://registry.npmjs.org',
]),
].map(async (url) => {
try {
Expand Down

0 comments on commit 342bd84

Please sign in to comment.