Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/utils/map-to-registry.js9
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)
}
}