Permalink
Browse files

Only rename .gyp files in the package root, not elsewhere

  • Loading branch information...
1 parent f468af8 commit efdab7d00f5d16763fd088b8fd0436dcfdcbd38e @isaacs isaacs committed Apr 16, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 fstream-npm.js
View
@@ -268,7 +268,9 @@ Packer.prototype.emitEntry = function (entry) {
}
// all *.gyp files are renamed to binding.gyp for node-gyp
- if (entry.basename.match(/\.gyp$/)) {
+ // but only when they are in the same folder as a package.json file.
+ if (entry.basename.match(/\.gyp$/) &&
+ this.entries.indexOf("package.json") !== -1) {
entry.basename = "binding.gyp"
entry.path = path.resolve(entry.dirname, entry.basename)
}

0 comments on commit efdab7d

Please sign in to comment.