Permalink
Browse files

Track readmeFilename as well as readme contents

  • Loading branch information...
1 parent c86ff09 commit a30c386fa02f8aa437c2c41b01fa7d3ea0353f6d @isaacs isaacs committed Oct 11, 2012
Showing with 3 additions and 0 deletions.
  1. +2 −0 read-json.js
  2. +1 −0 test/basic.js
View
@@ -240,10 +240,12 @@ function readme (file, data, cb) {
})
}
function readme_(file, data, rm, cb) {
+ var rmfn = path.basename(rm);
fs.readFile(rm, "utf8", function (er, rm) {
// maybe not readable, or something.
if (er) return cb()
data.readme = rm
+ data.readmeFilename = rmfn
return cb(er, data)
})
}
View
@@ -23,6 +23,7 @@ function basic_ (t, data) {
t.equal(data.readme, readme)
t.deepEqual(data.scripts, package.scripts)
t.equal(data.main, package.main)
+ t.equal(data.readmeFilename, 'README.md')
// optional deps are folded in.
t.deepEqual(data.optionalDependencies,

0 comments on commit a30c386

Please sign in to comment.