diff options
author | Eugene Sharygin <eush77@gmail.com> | 2015-06-12 10:52:27 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-06-19 05:20:10 +0300 |
commit | 9d8cac94a258db648a2b1069b1c8c6529c79d013 (patch) | |
tree | 0d7613267dce391af9685c5ba06d87e1f734335b /lib/view.js | |
parent | 5018335ce1754a9f771954ecbc1a93acde9b8c0a (diff) |
view: remove extra newline from output
PR-URL: https://github.com/npm/npm/pull/8548
Diffstat (limited to 'lib/view.js')
-rw-r--r-- | lib/view.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/view.js b/lib/view.js index 47da39b64..9199d352a 100644 --- a/lib/view.js +++ b/lib/view.js @@ -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) { |