diff options
author | isaacs <i@izs.me> | 2011-10-03 04:17:35 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-10-03 04:17:35 +0400 |
commit | 8f9d4848afc177d4c758a4563da56b58db33949b (patch) | |
tree | f4060320bd32707e00d39368fc4d01b71a6f013a /lib/bugs.js | |
parent | 7814ae00806530f8c7180bc0ea88c22ceb1d5a64 (diff) |
Only open github issues page if it's a github repo
Diffstat (limited to 'lib/bugs.js')
-rw-r--r-- | lib/bugs.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bugs.js b/lib/bugs.js index aed731d64..39e746592 100644 --- a/lib/bugs.js +++ b/lib/bugs.js @@ -34,8 +34,9 @@ function bugs (args, cb) { if (Array.isArray(repo)) repo = repo.shift() if (repo.url) repo = repo.url log.verbose(repo, "repository") - if (repo) { - return open(repo.replace(/^git(@|:\/\/)/, 'http://') + if (repo && repo.match(/^(https?:\/\/|git(:\/\/|@))github.com/)) { + return open(repo.replace(/^git(@|:\/\/)/, "http://") + .replace(/^https?:\/\/github.com:/, "github.com/") .replace(/\.git$/, '')+"/issues", cb) } } |