Skip to content

Commit f27d5f0

Browse files
committed
Merge pull request #59 from CodeWriterWriter/master
added urlClone and urlSSH
2 parents 5b605dc + 8b4c65b commit f27d5f0

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/github.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ function queryGithub (msg, done) {
9090
params.state = 'open'
9191

9292
github.pullRequests.getAll(params, (err, prs) => {
93+
if (err) return done(err)
9394
var data = {
9495
name: msg.repo || '',
9596
user: msg.user || '',
@@ -98,15 +99,16 @@ function queryGithub (msg, done) {
9899
watches: repo.subscribers_count || '',
99100
forks: repo.forks_count || '',
100101
last: repo.pushed_at || '',
101-
urlRepo: msg.url || '',
102-
urlClone: repo.clone_url || '',
102+
urlRepo: 'https://github.com/' + msg.user + '/' + msg.repo,
103+
urlClone: 'git+https://github.com/' + msg.user + '/' + msg.repo + '.git',
104+
urlSSH: 'git@github.com:' + msg.user + '/' + msg.repo + '.git',
103105
pullRequests: prs && prs.length || 0,
104106
cached: Date.now()
105107
}
106108

107109
function complete (err) {
108-
if (err) return done (err)
109-
else done (null, data)
110+
if (err) return done(err)
111+
else done(null, data)
110112
}
111113

112114
cache.load$(msg.name, (err, cached) => {

0 commit comments

Comments
 (0)