aboutsummaryrefslogtreecommitdiff
path: root/deps/npm/lib/repo.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-10-24 09:21:59 -0700
committerisaacs <i@izs.me>2013-10-24 09:22:13 -0700
commitf6f176e10872cac9dcdcd46a92c9ebfe4740f117 (patch)
tree2928003417e60d9bad43056b8579171bf0e75552 /deps/npm/lib/repo.js
parent808a968409b6c6cc305506efd3caa4477a376125 (diff)
downloadandroid-node-v8-f6f176e10872cac9dcdcd46a92c9ebfe4740f117.tar.gz
android-node-v8-f6f176e10872cac9dcdcd46a92c9ebfe4740f117.tar.bz2
android-node-v8-f6f176e10872cac9dcdcd46a92c9ebfe4740f117.zip
npm@1.3.12
Diffstat (limited to 'deps/npm/lib/repo.js')
-rw-r--r--deps/npm/lib/repo.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js
index 19066c8228..c91e593bfd 100644
--- a/deps/npm/lib/repo.js
+++ b/deps/npm/lib/repo.js
@@ -15,6 +15,7 @@ var npm = require("./npm.js")
, log = require("npmlog")
, opener = require("opener")
, github = require('github-url-from-git')
+ , githubUserRepo = require("github-url-from-username-repo")
function repo (args, cb) {
if (!args.length) return cb(repo.usage)
@@ -23,7 +24,14 @@ function repo (args, cb) {
if (er) return cb(er)
var r = d.repository;
if (!r) return cb(new Error('no repository'));
- var url = github(r.url);
+ // XXX remove this when npm@v1.3.10 from node 0.10 is deprecated
+ // from https://github.com/isaacs/npm-www/issues/418
+ if (githubUserRepo(r.url))
+ r.url = githubUserRepo(r.url)
+
+ var url = github(r.url)
+ if (!url)
+ return cb(new Error('no repository: could not get url'))
opener(url, { command: npm.config.get("browser") }, cb)
})
}