From 7ae198b238b1b31e0a56811356378733fe6a44f0 Mon Sep 17 00:00:00 2001 From: Tim Rollet Date: Tue, 10 Oct 2017 01:58:53 -0400 Subject: [PATCH] Spruce up around the edges. --- src/roosay.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/roosay.js b/src/roosay.js index 4f6167c..c760519 100644 --- a/src/roosay.js +++ b/src/roosay.js @@ -1,11 +1,9 @@ #!/usr/bin/env node (function () { - var DEFAULT_LEN, ROO, BUBBLE_TOP_CHAR, textToRoo; DEFAULT_LEN = 35; - BUBBLE_TOP_CHAR = "-"; roo = ` @@ -34,7 +32,7 @@ } function rooify(text) { - var textLines, maxLineLength, finalOutput, bubbleHeader; + var textLines, finalOutput, bubbleHeader; finalOutput = ""; textLines = lineify(DEFAULT_LEN)(text); bubbleHeader = new Array(DEFAULT_LEN+2).fill(BUBBLE_TOP_CHAR).join(""); @@ -44,6 +42,7 @@ finalOutput += roo; return finalOutput; } + if (process.stdin.isTTY) { textToRoo = process.argv.splice(2).join(" "); console.log(rooify(textToRoo)); @@ -53,6 +52,4 @@ process.stdin.on('end', _ => console.log(rooify(textToRoo))); process.stdin.resume(); } - - module.exports = {lineify}; }()); \ No newline at end of file