Skip to content

Commit

Permalink
Don't crash on empty bindir
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 10, 2011
1 parent d1944cb commit 8a0b3c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils/load-package-defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function readDefaultBins (pkgDir) { return function (pkg, cb) {
var binDir = path.join(pkgDir, bin)
pkg.bin = {}
find(binDir, function (er, filenames) {
if (er) return cb(er)
if (er || !filenames || !filenames.length) return cb(er, pkg)
var cut = pkgDir === "." ? 0 : pkgDir.length + 1
, binCut = pkgDir === "." ? bin.length - 1 : binDir.length + 1
filenames.filter(function (f) {
Expand Down

0 comments on commit 8a0b3c7

Please # to comment.