Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Commit

Permalink
Merge pull request #60 from coolaj86/master
Browse files Browse the repository at this point in the history
assume "index" if `main` is absent from package.json
  • Loading branch information
fat committed Aug 9, 2011
2 parents cc6b579 + 6e7a932 commit 40a31ce
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/ender.file.js
Expand Up @@ -276,7 +276,9 @@ ENDER.file = module.exports = {
return callback(null, tree)
}

dependencies = Object.keys(dependencies)
if (!Array.isArray(dependencies)) {
dependencies = Object.keys(dependencies)
}

if (isInstallingFromRoot) {
return ENDER.file.constructDependencyTree(dependencies, directory, function (err, result) {
Expand Down Expand Up @@ -392,7 +394,7 @@ ENDER.file = module.exports = {
packageJSON = JSON.parse(data)

if (!packageJSON.main) {
packageJSON.main = []
packageJSON.main = ["index"]
} else if (typeof packageJSON.main == 'string') {
packageJSON.main = [packageJSON.main]
}
Expand Down Expand Up @@ -465,4 +467,4 @@ ENDER.file = module.exports = {
})
}

}
}

0 comments on commit 40a31ce

Please sign in to comment.