Permalink
Browse files

correctly remove readme from default npm view command.

  • Loading branch information...
1 parent f322b0d commit d4af8a75ae92ec7612a91c6b49c27a9f7da655ec @timoxley committed Feb 23, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/view.js
View
@@ -70,17 +70,17 @@ function view (args, silent, cb) {
data.versions = Object.keys(data.versions).sort(semver.compare)
if (!args.length) args = [""]
- if (-1 === args.indexOf("readme")) {
- delete data.readme
- }
-
Object.keys(versions).forEach(function (v) {
try {
versions[v] = readJson.processJson(versions[v])
} catch (ex) {
delete versions[v]
}
if (semver.satisfies(v, version)) args.forEach(function (args) {
+ // remove readme unless we asked for it
+ if (-1 === args.indexOf("readme")) {
+ delete versions[v].readme
+ }
results.push(showFields(data, versions[v], args))
})
})

0 comments on commit d4af8a7

Please sign in to comment.