diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2014-06-18 11:19:39 +0400 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2014-07-02 05:43:16 +0400 |
commit | 0689ba249b92b4c6279a26804c96af6f92b3a501 (patch) | |
tree | c1d56154d44ee0f25eefbd0bdc5c8c4413007721 /lib/bugs.js | |
parent | 4441ea1ca17c584a12c266beacf4f9a77d763dfc (diff) |
use --scope to map scope to registry
Diffstat (limited to 'lib/bugs.js')
-rw-r--r-- | lib/bugs.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/lib/bugs.js b/lib/bugs.js index b3022bf2a..41f1386b0 100644 --- a/lib/bugs.js +++ b/lib/bugs.js @@ -10,13 +10,16 @@ var npm = require("./npm.js") , path = require("path") , readJson = require("read-package-json") , fs = require("fs") - , url = require("url") + , mapToRegistry = require("./utils/map-to-registry.js") bugs.completion = function (opts, cb) { if (opts.conf.argv.remain.length > 2) return cb() - var uri = url.resolve(npm.config.get("registry"), "-/short") - registry.get(uri, { timeout : 60000 }, function (er, list) { - return cb(null, list || []) + mapToRegistry("-/short", npm.config, function (er, uri) { + if (er) return cb(er) + + registry.get(uri, { timeout : 60000 }, function (er, list) { + return cb(null, list || []) + }) }) } @@ -56,9 +59,13 @@ function getUrlAndOpen (d, cb) { } function callRegistry (n, cb) { - var uri = url.resolve(npm.config.get("registry"), n + "/latest") - registry.get(uri, { timeout : 3600 }, function (er, d) { + mapToRegistry(n, npm.config, function (er, uri) { if (er) return cb(er) - getUrlAndOpen (d, cb) + + registry.get(uri + "/latest", { timeout : 3600 }, function (er, d) { + if (er) return cb(er) + + getUrlAndOpen (d, cb) + }) }) } |