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:
authorisaacs <i@izs.me>2011-04-01 02:18:59 +0400
committerisaacs <i@izs.me>2011-04-01 02:18:59 +0400
commit54f56648c4588bb3e8ec8cfadeb610b48a34e000 (patch)
tree55834bc63fef95d96eeb5e539308a8d07d1ff364 /lib/docs.js
parent29e61f011713331aabfdf451fdb928d6c0a8f561 (diff)
Parse repo url when it's just a string
Diffstat (limited to 'lib/docs.js')
-rw-r--r--lib/docs.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/docs.js b/lib/docs.js
index 48b1b98b9..190e1a21b 100644
--- a/lib/docs.js
+++ b/lib/docs.js
@@ -24,9 +24,11 @@ function docs (args, cb) {
if (homepage) return open(homepage, cb)
if (repo) {
if (Array.isArray(repo)) repo = repo.shift()
- if (repo.url) {
- return open(repo.url.replace(/^git(@|:\/\/)/, 'http://')
- .replace(/\.git$/, '')+"#readme", cb)
+ if (repo.url) repo = repo.url
+ log.verbose(repo, "repository")
+ if (repo) {
+ return open(repo.replace(/^git(@|:\/\/)/, 'http://')
+ .replace(/\.git$/, '')+"#readme", cb)
}
}
log.error(n+" doesn't appear to have a 'homepage'"