diff options
author | isaacs <i@izs.me> | 2011-06-22 00:44:59 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2011-06-22 00:44:59 +0400 |
commit | 9a343356d606eb72e088b86c572ec0badc6eb295 (patch) | |
tree | 3f1008da096b4cd48c6a03a489e0b6a0935628cd | |
parent | 4c84a132f272d8a700a6ebbf5ebfc9c2d28ffb31 (diff) |
Handle 'files':[''] case
-rw-r--r-- | lib/utils/tar.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/utils/tar.js b/lib/utils/tar.js index 66a8a3a19..12b4de3e6 100644 --- a/lib/utils/tar.js +++ b/lib/utils/tar.js @@ -452,6 +452,13 @@ function makeList_ (dir, pkg, exList, dfc, cb) { if (!pkg) return cb(new Error("No package.json file in "+dir)) if (pkg.path === dir && pkg.files) { + pkg.files = pkg.files.filter(function (f) { + f = f.trim() + return f && f.charAt(0) !== "#" + }) + if (!pkg.files.length) pkg.files = null + } + if (pkg.path === dir && pkg.files) { // stuff on the files list MUST be there. // ignore everything, then include the stuff on the files list. var pkgFiles = ["*"].concat(pkg.files.map(function (f) { |