Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Console error code of 2 during successful commands? #74

Closed
willsmanley opened this issue Aug 6, 2020 · 7 comments
Closed

Console error code of 2 during successful commands? #74

willsmanley opened this issue Aug 6, 2020 · 7 comments
Assignees
Labels
question Further information is requested

Comments

@willsmanley
Copy link

Not sure if this is the intended behavior, but when I run the command successfully, it still outputs a console error code of "2". If I understand correctly, a successful command should output "0" for successful executions.

Is this the correct behavior?

If desired I can fill out the full bug report, but I figured a quick post would be better to address this small issue.

Otherwise thanks for the awesome package!

@rajkumaar23
Copy link
Contributor

So, basically the command will exit with a status code of 2 if the website you're trying to run the command against has vulnerabilities.

if (audit.hasVulnerabilities(results)) {
process.exit(2)

@willsmanley
Copy link
Author

Ok thanks for letting me know. Is there an exit status code for unsuccessful commands (such as the website DNS records could not be found)?

@rajkumaar23
Copy link
Contributor

Yes, it is 1

console.error(`\nError: ${error.message}\n`)
console.error('Usage:\n is-website-vulnerable https://www.google.com\n\n')
process.exit(1)

@lirantal lirantal added the question Further information is requested label Aug 8, 2020
@lirantal
Copy link
Owner

lirantal commented Aug 8, 2020

Thanks Raj for picking up this one!

@lirantal lirantal closed this as completed Aug 8, 2020
@Ryuno-Ki
Copy link
Collaborator

Should we document those Exit codes in the README, @lirantal?

@lirantal
Copy link
Owner

@Ryuno-Ki yes, sounds like a great idea!
Can you open a PR to add?

@lirantal lirantal reopened this Oct 16, 2020
@Ryuno-Ki Ryuno-Ki mentioned this issue Oct 16, 2020
9 tasks
@Ryuno-Ki
Copy link
Collaborator

At your command: #81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants