Skip to content

Commit

Permalink
Hack to get issue data
Browse files Browse the repository at this point in the history
  • Loading branch information
zjk committed Aug 21, 2016
1 parent e905d03 commit e7a7b17
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions ex.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ var opts = {
}

// crawl('jbenet/random-ideas', function (err, graph) {
// crawl('noffle/github-dependency-crawl', function (err, graph) {
crawl(opts, function (err, graph) {
crawl('noffle/github-dependency-crawl', function (err, graph, issues) {
//crawl(opts, function (err, graph) {
if (err) return console.log(err)

console.log(graph)
console.log(issues)
})


Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ var urlMatch = require('url-regexp').match
var urlParse = require('url').parse
var asyncReduce = require('async').reduce

var ISSUES = {};

// TODO: consider using a github api module instead of http api directly

module.exports = function (opts, cb) {
Expand Down Expand Up @@ -89,7 +91,7 @@ module.exports = function (opts, cb) {

// Base case; all is resolved already
if (!unresolved.length) {
return cb(null, graph)
return cb(null, graph, ISSUES)
}

// TODO: a possible optimization might be to check if there are e.g. > N
Expand Down Expand Up @@ -322,6 +324,8 @@ function githubIssuesToDependencyGraph (issues) {
extractDependencyUrls(issue.body, orgRepo),
dependencyUrlToCanonicalName)

ISSUES[name] = issue;

var res = {}
res[name] = deps
return res
Expand Down

0 comments on commit e7a7b17

Please sign in to comment.