From 4557db53f81137a1179fbf0a2fda2d5ba6a2878d Mon Sep 17 00:00:00 2001 From: Mike Donnalley Date: Thu, 18 Jan 2024 09:24:31 -0700 Subject: [PATCH] fix: respect scoped NPM_REGISTRY env var when running npm show --- src/plugins.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins.ts b/src/plugins.ts index 0ff10f20..bc20bb01 100644 --- a/src/plugins.ts +++ b/src/plugins.ts @@ -396,8 +396,10 @@ export default class Plugins { this.debug(`Using node executable located at: ${nodeExecutable}`) this.debug(`Using npm executable located at: ${npmCli}`) + const registry = this.config.scopedEnvVar('NPM_REGISTRY') + const registryFlag = registry ? `--registry=${registry}` : '' // wrap node and path in double quotes to deal with spaces - const command = `"${nodeExecutable}" "${npmCli}" show ${name} dist-tags` + const command = `"${nodeExecutable}" "${npmCli}" show ${name} dist-tags ${registryFlag}` let npmShowResult try {