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

Commit e1693fc

Browse files
committed
only set any main if found
1 parent 3caa616 commit e1693fc

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

github.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -813,7 +813,7 @@ GithubLocation.prototype = {
813813
return checkMain(main, libDir)
814814
.then(function(hasMain) {
815815
if (hasMain)
816-
return;
816+
return hasMain;
817817

818818
return asp(fs.readFile)(path.resolve(dir, 'bower.json'))
819819
.then(function(bowerJson) {
@@ -831,11 +831,17 @@ GithubLocation.prototype = {
831831
return checkMain(main);
832832
}, function() {})
833833
.then(function(hasBowerMain) {
834-
if (!hasBowerMain)
835-
return;
834+
if (hasBowerMain)
835+
return hasBrowserMain;
836836

837-
pjson.main = main;
837+
main = 'index';
838+
return checkMain(main, libDir);
838839
});
840+
})
841+
.then(function(hasMain) {
842+
if (hasMain)
843+
packageConfig.main = main;
844+
return packageConfig;
839845
});
840846
}
841847

0 commit comments

Comments
 (0)