diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-03-20 06:55:52 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-03-20 06:55:52 +0300 |
commit | 3a127235076a1f00bc8befba56c024c6d0e7f477 (patch) | |
tree | 80278dd19e462c25a2b6883764f4cff4f483571d /lib | |
parent | 89ce829a00b526d0518f5cd855c323bffe182af0 (diff) |
adduser: explicit registry on command line wins
It turns out that config-chain allows you to query a specific config
source by type, which allows us to see whether specific config values
were set explicitly on the command line. Who knew? (Aside from @isaacs
and @dominictarr.)
Anyway, doing this required a small, noninvasive change to
test/tap/config-meta.js so that it didn't try to match the entire set of
parameters passed to `config.get` when doing its metaprogramming thing.
Fixes #7661.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/adduser.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/adduser.js b/lib/adduser.js index 6c8a652be..f59372a29 100644 --- a/lib/adduser.js +++ b/lib/adduser.js @@ -135,7 +135,8 @@ function save (c, u, cb) { if (scope.charAt(0) !== "@") scope = "@" + scope var scopedRegistry = npm.config.get(scope + ":registry") - if (scopedRegistry) uri = scopedRegistry + var cliRegistry = npm.config.get("registry", "cli") + if (scopedRegistry && !cliRegistry) uri = scopedRegistry } var params = { |