Browse files

readFile != stat

  • Loading branch information...
1 parent 1cdc0cb commit ddea2b669688c0a99ec9f871931a77815030b9ee @isaacs isaacs committed Apr 30, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/utils/read-json.js
View
8 lib/utils/read-json.js
@@ -38,7 +38,7 @@ function readJson (jsonFile, opts, cb) {
wscript = opts.wscript
next()
} else fs.readFile( path.join(path.dirname(jsonFile), "wscript")
- , function (er, data) {
+ , function (er, data) {
if (er) opts.wscript = false
else opts.wscript = !!(data.toString().match(/(^|\n)def build\b/)
&& data.toString().match(/(^|\n)def configure\b/))
@@ -50,7 +50,7 @@ function readJson (jsonFile, opts, cb) {
contributors = opts.contributors
next()
} else fs.readFile( path.join(path.dirname(jsonFile), "AUTHORS")
- , function (er, data) {
+ , function (er, data) {
if (er) opts.contributors = false
else {
data = data.toString().split(/\r?\n/).map(function (l) {
@@ -66,8 +66,8 @@ function readJson (jsonFile, opts, cb) {
if (opts.serverjs != null) {
serverjs = opts.serverjs
next()
- } else fs.readFile( path.join(path.dirname(jsonFile), "server.js")
- , function (er, st) {
+ } else fs.stat( path.join(path.dirname(jsonFile), "server.js")
+ , function (er, st) {
if (er) opts.serverjs = false
else opts.serverjs = st.isFile()
serverjs = opts.serverjs

0 comments on commit ddea2b6

Please sign in to comment.