Permalink
Browse files

Don't rename gypfiles on the fs. Reader does that

  • Loading branch information...
1 parent 76f1ec4 commit 9716e974c45df345a48de1ca813f871a1033e43a @isaacs isaacs committed Mar 27, 2012
Showing with 1 addition and 17 deletions.
  1. +1 −17 lib/utils/read-json.js
View
@@ -52,27 +52,11 @@ function readJson (jsonFile, opts, cb) {
if (er) return hasGyp(false)
// see if there are any *.gyp files in there.
- // If there are, then copy them to binding.gyp
- // if there are not, then just proceed without
gf = gf.filter(function (f) {
return f.match(/\.gyp$/)
})
gf = gf[0]
- if (!gf) return hasGyp(false)
- if (gf === "binding.gyp") return hasGyp(true)
-
- // need to rename. windows is annoying.
- // why not fs.rename? because we just saw the file, so it'll
- // be cached for potentially several seconds on a network share.
- return fs.readFile(path.resolve(pkgdir, gf), function (er, d) {
- if (er) return hasGyp(false)
- fs.writeFile(path.resolve(pkgdir, "binding.gyp"), d, function (er) {
- if (er) return hasGyp(false)
- fs.unlink(path.resolve(pkgdir, gf), function (er) {
- return hasGyp(!er)
- })
- })
- })
+ return hasGyp(!!gf)
})
}

0 comments on commit 9716e97

Please sign in to comment.