mhulse / node-boilerplate-cli

A simple boilerplate starting point for Node.js command line projects.
Apache License 2.0
18 stars 9 forks source link

Test && via command line #8

Closed mhulse closed 7 years ago

mhulse commented 7 years ago

I want my node CLI apps to chain via command line; I need to make sure this works as I have just tested a CLI script and it quits before continuing to next CLI. I think it has to do with exit codes.

mhulse commented 7 years ago

WTF was I thinking. The default exit code for exitGraceful is 1. That means there was an error. I want the default to be 0! I'll need to make sure my other apps that use this code are explicit about errors/exits and implicit otherwise.

In fact, it's probably better to catch/throw and recover rather than use process.exit(1):

https://www.nczonline.net/blog/2014/02/04/maintainable-node-js-javascript-avoid-process-exit/