diff --git a/lib/github.js b/lib/github.js index b2271a8..26ebc7e 100644 --- a/lib/github.js +++ b/lib/github.js @@ -90,6 +90,7 @@ function queryGithub (msg, done) { params.state = 'open' github.pullRequests.getAll(params, (err, prs) => { + if (err) return done(err) var data = { name: msg.repo || '', user: msg.user || '', @@ -98,15 +99,16 @@ function queryGithub (msg, done) { watches: repo.subscribers_count || '', forks: repo.forks_count || '', last: repo.pushed_at || '', - urlRepo: msg.url || '', - urlClone: repo.clone_url || '', + urlRepo: 'https://github.com/' + msg.user + '/' + msg.repo, + urlClone: 'git+https://github.com/' + msg.user + '/' + msg.repo + '.git', + urlSSH: 'git@github.com:' + msg.user + '/' + msg.repo + '.git', pullRequests: prs && prs.length || 0, cached: Date.now() } function complete (err) { - if (err) return done (err) - else done (null, data) + if (err) return done(err) + else done(null, data) } cache.load$(msg.name, (err, cached) => {