Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #8 from djalmaaraujo/fetch-from-default-branch

Make repository request from default branch instead of master only
  • Loading branch information...
commit e707634783a9b535c9402ded91637123ba585c78 2 parents 75b08af + 1c6dc86
@sindresorhus sindresorhus authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 component-list.js
View
8 component-list.js
@@ -44,8 +44,8 @@ function getDiffFromExistingRepos(newRepos) {
}
}
-function fetchKeywords(user, repo, file, cb) {
- var url = 'https://raw.github.com/' + user + '/' + repo + '/master/'+ file;
+function fetchKeywords(repoJson, file, cb) {
+ var url = 'https://raw.github.com/' + repoJson.owner.login + '/' + repoJson.name + '/' + repoJson.default_branch + '/'+ file;
request.get(url, {json: true}, function (err, response, body) {
if (!err && body && body.keywords) {
@@ -110,9 +110,9 @@ function fetchComponents(fetchNew) {
deferred.resolve(createComponentData(el.name, body, keywords));
};
- fetchKeywords(user, repo, 'bower.json', function (err, keywords) {
+ fetchKeywords(body, 'bower.json', function (err, keywords) {
if (err) {
- fetchKeywords(user, repo, 'package.json', function (err, keywords) {
+ fetchKeywords(body, 'package.json', function (err, keywords) {
complete(keywords);
});
return;
Please sign in to comment.
Something went wrong with that request. Please try again.