educastellano / jsonlint-tree

jsonlint a directory recursively
8 stars 7 forks source link

feature request: exit codes #4

Closed alvaropinot closed 7 years ago

alvaropinot commented 7 years ago

I think It could be really useful if an exit code is added so this can be used in CI environments :)

something like exit 0 for no errors and exit 1 whenever there are some failures. This way the this could be integrated into the npm scripts of a project for example.

I did this quick hack as a poc, if you like the idea I'll be glad to submit a PR :)

...
if (passed+failed === files.length) {
   ...
   process.exit(failed)
}
...

What do you think?

alvaropinot commented 7 years ago

there is the PR just in case :P

educastellano commented 7 years ago

Great! I think I'm gonna use it 😃 Thanks

educastellano commented 7 years ago

released @1.2.0 👍