Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
correct main handling
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford committed Dec 5, 2015
1 parent c7fff5e commit 687845d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions github.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,8 +282,7 @@ GithubLocation.configure = function(config, ui) {
});
};

// regular expression to verify package names
GithubLocation.packageFormat = /^[^\/]+\/[^\/]+/;
GithubLocation.packageNameFormats = ['*/*'];

GithubLocation.prototype = {

Expand Down Expand Up @@ -569,9 +568,9 @@ GithubLocation.prototype = {
},

// check if the main entry point exists. If not, try the bower.json main.
build: function(pjson, dir) {
var main = pjson.main || '';
var libDir = pjson.directories && (pjson.directories.dist || pjson.directories.lib) || '.';
processPackage: function(packageConfig, packageName, dir) {
var main = packageConfig.main || '';
var libDir = packageConfig.directories && (packageConfig.directories.dist || packageConfig.directories.lib) || '.';

if (main instanceof Array)
main = main[0];
Expand Down Expand Up @@ -622,7 +621,7 @@ GithubLocation.prototype = {
}, function() {})
.then(function(hasBowerMain) {
if (hasBowerMain)
return hasBrowserMain;
return hasBowerMain;

main = 'index';
return checkMain(main, libDir);
Expand Down

0 comments on commit 687845d

Please sign in to comment.