Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

correctly remove readme from default npm view command.

  • Loading branch information...
commit d4af8a75ae92ec7612a91c6b49c27a9f7da655ec 1 parent f322b0d
@timoxley authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/view.js
View
8 lib/view.js
@@ -70,10 +70,6 @@ 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])
@@ -81,6 +77,10 @@ function view (args, silent, cb) {
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))
})
})
Please sign in to comment.
Something went wrong with that request. Please try again.