Skip to content

Commit

Permalink
view: remove extra newline from output
Browse files Browse the repository at this point in the history
PR-URL: npm/npm#8548
  • Loading branch information
eush77 authored and othiym23 committed Jun 19, 2015
1 parent 5018335 commit 9d8cac9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,13 @@ function printData (data, name, cb) {
})
})

console.log(msg)
// preserve output symmetry by adding a whitespace-only line at the end if
// there's one at the beginning
if (/^\s*\n/.test(msg)) msg += "\n"

// print directly to stdout to not unnecessarily add blank lines
process.stdout.write(msg)

cb(null, data)
}
function cleanup (data) {
Expand Down

0 comments on commit 9d8cac9

Please sign in to comment.