doyensec / electronegativity

Electronegativity is a tool to identify misconfigurations and security anti-patterns in Electron applications.
Apache License 2.0
970 stars 66 forks source link

Exit code when finding any issues in cli mode #108

Open planetsLightningArrester opened 10 months ago

planetsLightningArrester commented 10 months ago

Is your feature request related to a problem? Please describe. I searched the README and the Wiki but couldn't find a built-in way to check if CLI call of npx electronegativity found any errors in an automated way. I saw it's possible to run a JS script importing electronegativity, but I'd like to use it in the CLI as part of my workflow validation, so it'd be easier if I could get only a pass/fail result as an exit code instead of creating a script to try/catch it

Describe the solution you'd like Create an option to return an exit code in CLI mode when issues are detected

Describe alternatives you've considered I could create a script, as I mentioned, but I could also pipe the stdout result to grep for No issues were found. The drawback of this approach is that it's not cross-platform. So, my Windows development would suffer, and kind of boils down back to making a script. An exit code would solve it.

Additional context Nothing to add.

Thank you!