From a15da454da319ea236dec394a1c1dc8a49d53580 Mon Sep 17 00:00:00 2001 From: matthiasg Date: Thu, 16 Apr 2015 15:07:29 +0200 Subject: [PATCH] Added multi-line output support --- lib/main.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/main.js b/lib/main.js index 4233ba0..db5ca8c 100644 --- a/lib/main.js +++ b/lib/main.js @@ -33,14 +33,22 @@ module.exports = function (options) { errorCache = err; } else { var lines = stdout.split("\n"); + var collect = false; for(var i in lines) { if(lines[i] == 'Raw result:') { - qrcode = lines[parseInt(i)+1]; - break; + collect = true; + continue; + } + else if(lines[i] === 'Parsed result:') { + collect = false; + break; } - } + if(collect){ + qrcode += lines[parseInt(i)]; + } + } } cb(errorCache, qrcode); }