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
diff options
context:
space:
mode:
authorForrest L Norvell <forrest@npmjs.com>2014-07-01 21:59:22 +0400
committerForrest L Norvell <forrest@npmjs.com>2014-07-01 22:09:40 +0400
commitf6874335d22290788b625b3b147958bde4f1aa7e (patch)
tree61c30c326488be931b2d72d7c696c9b505ec60de
parentbea190c745f10d21cce45687298b13b6d9d7a10c (diff)
relative URLS for working non-root registry URLS
-rw-r--r--lib/bugs.js2
-rw-r--r--lib/install.js2
-rw-r--r--lib/owner.js10
-rw-r--r--lib/search.js2
-rw-r--r--lib/star.js2
-rw-r--r--lib/unpublish.js2
-rw-r--r--lib/view.js2
7 files changed, 11 insertions, 11 deletions
diff --git a/lib/bugs.js b/lib/bugs.js
index 9584c326c..b3022bf2a 100644
--- a/lib/bugs.js
+++ b/lib/bugs.js
@@ -14,7 +14,7 @@ var npm = require("./npm.js")
bugs.completion = function (opts, cb) {
if (opts.conf.argv.remain.length > 2) return cb()
- var uri = url.resolve(npm.config.get("registry"), "/-/short")
+ var uri = url.resolve(npm.config.get("registry"), "-/short")
registry.get(uri, { timeout : 60000 }, function (er, list) {
return cb(null, list || [])
})
diff --git a/lib/install.js b/lib/install.js
index c1f923e66..8f20bc839 100644
--- a/lib/install.js
+++ b/lib/install.js
@@ -34,7 +34,7 @@ install.completion = function (opts, cb) {
// if it starts with https?://, then just give up, because it's a url
// for now, not yet implemented.
var registry = npm.registry
- , uri = url.resolve(npm.config.get("registry"), "/-/short")
+ , uri = url.resolve(npm.config.get("registry"), "-/short")
registry.get(uri, null, function (er, pkgs) {
if (er) return cb()
if (!opts.partialWord) return cb(null, pkgs)
diff --git a/lib/owner.js b/lib/owner.js
index 45ef8c833..34dbbc247 100644
--- a/lib/owner.js
+++ b/lib/owner.js
@@ -19,13 +19,13 @@ owner.completion = function (opts, cb) {
switch (argv[2]) {
case "ls":
if (argv.length > 3) return cb()
- uri = url.resolve(npm.config.get("registry"), "/-/short")
+ uri = url.resolve(npm.config.get("registry"), "-/short")
return registry.get(uri, null, cb)
case "rm":
if (argv.length > 3) {
theUser = encodeURIComponent(argv[3])
- uri = url.resolve(npm.config.get("registry"), "/-/by-user/"+theUser+"|"+un)
+ uri = url.resolve(npm.config.get("registry"), "-/by-user/"+theUser+"|"+un)
console.error(uri)
return registry.get(uri, null, function (er, d) {
if (er) return cb(er)
@@ -40,7 +40,7 @@ owner.completion = function (opts, cb) {
case "add":
if (argv.length > 3) {
theUser = encodeURIComponent(argv[3])
- uri = url.resolve(npm.config.get("registry"), "/-/by-user/"+theUser+"|"+un)
+ uri = url.resolve(npm.config.get("registry"), "-/by-user/"+theUser+"|"+un)
console.error(uri)
return registry.get(uri, null, function (er, d) {
console.error(uri, er || d)
@@ -54,7 +54,7 @@ owner.completion = function (opts, cb) {
})
}
// just list all users who aren't me.
- uri = url.resolve(npm.config.get("registry"), "/-/users")
+ uri = url.resolve(npm.config.get("registry"), "-/users")
return registry.get(uri, null, function (er, list) {
if (er) return cb()
return cb(null, Object.keys(list).filter(function (n) {
@@ -156,7 +156,7 @@ function rm (user, pkg, cb) {
function mutate (pkg, user, mutation, cb) {
if (user) {
- var uri = url.resolve(npm.config.get("registry"), "/-/user/org.couchdb.user:"+user)
+ var uri = url.resolve(npm.config.get("registry"), "-/user/org.couchdb.user:"+user)
registry.get(uri, null, mutate_)
} else {
mutate_(null, null)
diff --git a/lib/search.js b/lib/search.js
index 06907dfe4..e7892350c 100644
--- a/lib/search.js
+++ b/lib/search.js
@@ -63,7 +63,7 @@ function getFilteredData (staleness, args, notArgs, cb) {
follow : true,
staleOk : true
}
- var uri = url.resolve(npm.config.get("registry"), "/-/all")
+ var uri = url.resolve(npm.config.get("registry"), "-/all")
registry.get(uri, opts, function (er, data) {
if (er) return cb(er)
return cb(null, filter(data, args, notArgs))
diff --git a/lib/star.js b/lib/star.js
index bf68582ca..9c0b4ea9e 100644
--- a/lib/star.js
+++ b/lib/star.js
@@ -11,7 +11,7 @@ star.usage = "npm star <package> [pkg, pkg, ...]\n"
+ "npm unstar <package> [pkg, pkg, ...]"
star.completion = function (opts, cb) {
- var uri = url.resolve(npm.config.get("registry"), "/-/short")
+ var uri = url.resolve(npm.config.get("registry"), "-/short")
registry.get(uri, { timeout : 60000 }, function (er, list) {
return cb(null, list || [])
})
diff --git a/lib/unpublish.js b/lib/unpublish.js
index 64d022fe0..225c1c3c4 100644
--- a/lib/unpublish.js
+++ b/lib/unpublish.js
@@ -14,7 +14,7 @@ unpublish.completion = function (opts, cb) {
if (opts.conf.argv.remain.length >= 3) return cb()
var un = encodeURIComponent(npm.config.get("username"))
if (!un) return cb()
- var uri = url.resolve(npm.config.get("registry"), "/-/by-user/"+un)
+ var uri = url.resolve(npm.config.get("registry"), "-/by-user/"+un)
registry.get(uri, null, function (er, pkgs) {
// do a bit of filtering at this point, so that we don't need
// to fetch versions for more than one thing, but also don't
diff --git a/lib/view.js b/lib/view.js
index 4931caef7..33bf550dd 100644
--- a/lib/view.js
+++ b/lib/view.js
@@ -6,7 +6,7 @@ view.usage = "npm view pkg[@version] [<field>[.subfield]...]"
view.completion = function (opts, cb) {
var uri
if (opts.conf.argv.remain.length <= 2) {
- uri = url.resolve(npm.config.get("registry"), "/-/short")
+ uri = url.resolve(npm.config.get("registry"), "-/short")
return registry.get(uri, null, cb)
}
// have the package, get the fields.