Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Make repository request from default branch instead of master only #8

Merged
merged 1 commit into from

3 participants

@djalmaaraujo

We are adding this change because some repositories uses different branches as their default branch.
They may use "gh-pages" or "dev" as a default branch.

@zenorocha

+1

This will fix the problem we are facing to fetch elements in customelements.io.

@sindresorhus sindresorhus merged commit e707634 into bower:master
@sindresorhus
Owner

Thanks. Deployed :)

@djalmaaraujo
@zenorocha

Thanks Sindre :)

@djalmaaraujo djalmaaraujo deleted the djalmaaraujo:fetch-from-default-branch branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 25, 2014
  1. @djalmaaraujo
This page is out of date. Refresh to see the latest.
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;
Something went wrong with that request. Please try again.