Skip to content

Commit

Permalink
Merge pull request #25 from MUCHZER/patch-3
Browse files Browse the repository at this point in the history
Added process.exit and removed google chrome as opn browser
  • Loading branch information
WeiChiaChang authored Dec 22, 2017
2 parents 0dc4314 + 755a70e commit f3cd5c1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down Expand Up @@ -147,7 +152,8 @@ let search = function(website) {
})
.catch(error => {
console.error(error);
});
})
.then(() => process.exit());
}

let run = function (obj) {
Expand All @@ -156,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') {
Expand Down

0 comments on commit f3cd5c1

Please sign in to comment.