From acf672968721a31e9139df9c57b08690cca9394d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20GRAND?= Date: Wed, 29 Nov 2017 11:00:14 +0100 Subject: [PATCH 1/2] Added process.exit after work is done! --- bin/cli.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bin/cli.js b/bin/cli.js index 6786ca5..659475a 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -83,7 +83,12 @@ let search = function(website) { wappalyzer.analyze(website) .then(json => { spinner.stop(); - // console.log(json.length); + + if(json.length === 0) { + console.log(`${website} doesn\'t respond or no data! :(`); + process.exit(); + } + for (let num = 0; num < json.length; num ++) { stackInfo.push(new Array()); @@ -147,7 +152,8 @@ let search = function(website) { }) .catch(error => { console.error(error); - }); + }) + .then(() => process.exit()); } let run = function (obj) { From 755a70e834c93c7d4a08ca92e484e4ae03656437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20GRAND?= Date: Wed, 29 Nov 2017 11:01:04 +0100 Subject: [PATCH 2/2] Fixed default browser for -s cmd --- bin/cli.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/cli.js b/bin/cli.js index 659475a..9098c25 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -162,7 +162,7 @@ let run = function (obj) { } else if (obj[0] === '-h') { console.log(cliHelp.help); } else if (obj[0] === '-s') { - opn('https://github.com/WeiChiaChang/stacks-cli', {app: 'google chrome'}); + opn('https://github.com/WeiChiaChang/stacks-cli'); } else if (obj[0] === '-u') { obj[1] ? search(obj[1]) : console.log('Invalid URL!'); } else if (typeof obj[0] === 'string') {