diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2014-06-26 05:16:25 +0400 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2014-07-02 05:49:45 +0400 |
commit | 4f540437091d1cbca3915cd20c2da83c2a88bb8e (patch) | |
tree | ab0969a0bdba62a32824ecc91ed4bf95da9f1de3 /lib | |
parent | 2793877f5b412c200a249f928f81b4d1bc03a35f (diff) |
npm-package-arg@2.0.0
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/map-to-registry.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/utils/map-to-registry.js b/lib/utils/map-to-registry.js index 6f9abed97..cf665e4f6 100644 --- a/lib/utils/map-to-registry.js +++ b/lib/utils/map-to-registry.js @@ -12,19 +12,18 @@ function mapToRegistry(name, config, cb) { // the name itself takes precedence var data = npa(name) if (data.scope) { + // the name is definitely scoped, so escape now name = name.replace("/", "%2f") - var packageScope = "@" + data.scope - if (!packageScope) return cb(new Error("No scope found in scoped package named " + name)) - log.silly("mapToRegistry", "packageScope", packageScope) + log.silly("mapToRegistry", "scope", data.scope) - scopedRegistry = config.get(packageScope + ":registry") + scopedRegistry = config.get(data.scope + ":registry") if (scopedRegistry) { log.silly("mapToRegistry", "scopedRegistry (scoped package)", scopedRegistry) uri = url.resolve(scopedRegistry, name) } else { - log.verbose("mapToRegistry", "no registry URL found for scope", packageScope) + log.verbose("mapToRegistry", "no registry URL found for scope", data.scope) } } |