From a136d3823ddd9c3fc928f7cdbe6ed69143e512cf Mon Sep 17 00:00:00 2001 From: kumavis Date: Wed, 5 Jul 2017 09:59:24 -0700 Subject: [PATCH] cli - get - fix formatting when piping out --- src/cli/commands/block/get.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cli/commands/block/get.js b/src/cli/commands/block/get.js index 09c7a5a98f..f5b9e4fa4b 100644 --- a/src/cli/commands/block/get.js +++ b/src/cli/commands/block/get.js @@ -18,7 +18,10 @@ module.exports = { } process.stdout.write(block.data) - process.stdout.write('\n') + // only append a newline (for clean formatting) if outputting to terminal + if (process.stdout.isTTY) { + process.stdout.write('\n') + } }) } }