Last active
August 29, 2015 14:24
-
-
Save aroman/a6f62393b8087904c8d4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let Promise = require('bluebird'); | |
function showReposWithSomeFile() { | |
gh.request('GET /user/repos') | |
.map(repo => { | |
let someFileContents = gh.request('GET /repos/:owner/:repo/contents/:path', { | |
owner: repo.owner.login, | |
repo: repo.name, | |
path: 'someFile', | |
}); | |
return { | |
someFileContents, | |
repo: { | |
name: repo.name, | |
owner: repo.owner.login | |
} | |
} | |
}) | |
.filter([someFileContents, repo] => { | |
return appHubFileContents.state === 'fulfilled'; | |
}) | |
.each(repo => { | |
// Do something with the repos that have 'someFile' in them. | |
}) | |
.catch(next); | |
} |
petkaantonov
commented
Jul 3, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment