From 26d3ffd38b385f0f562b08b1f5c5e423a7d52b51 Mon Sep 17 00:00:00 2001 From: Douglas Matoso Date: Wed, 25 Oct 2017 11:35:59 -0200 Subject: [PATCH] Fix #28 by stripping the trailing new line (#29) --- cli.js | 2 +- package.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cli.js b/cli.js index b41a9a6..3f55ca2 100755 --- a/cli.js +++ b/cli.js @@ -46,7 +46,7 @@ if (argv.l) { } else { require("get-stdin")().then(function (data) { if (data) { - argv._ = [data]; + argv._ = [require("strip-eof")(data)]; say(); } else { showHelp(); diff --git a/package.json b/package.json index 0ca7e53..a524d2e 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,8 @@ "dependencies": { "get-stdin": "^5.0.1", "optimist": "~0.6.1", - "string-width": "~2.1.1" + "string-width": "~2.1.1", + "strip-eof": "^1.0.0" }, "devDependencies": { "nodeunit": "~0.11.1",