Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-05-01 02:28:40 +0400
committerisaacs <i@izs.me>2011-05-01 02:28:52 +0400
commitddea2b669688c0a99ec9f871931a77815030b9ee (patch)
tree000faf40f42f78548d3a985f87ded10cfb016834
parent1cdc0cbb4afc5381abe0559e3109bc8496846ac4 (diff)
readFile != stat
-rw-r--r--lib/utils/read-json.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/utils/read-json.js b/lib/utils/read-json.js
index c5cb2884d..6d4b73ac7 100644
--- a/lib/utils/read-json.js
+++ b/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