buggood first issue
描述
Hi 👋
When one of the actions of a generator fails, by default, every following actions are aborted. But the process is in success (see the screenshot, the smiley on the last prompt line is green 😄 ).

I guess in many cases this is fine. But I use the generator in the CI, then run the tests of the generated code to make sure they pass. If plop is failing, the CI continues because the exit code was 0 and not 1.
During my investigation I noticed that when executing an action, if it fails it is stored in the failures collection. But nothing is done in the generator promise.
I suggest
- to add an option in generators
abortOnFailset to false by default to ensure BC for other users - add a check in the promise to exit with code 1 if failures.length > 1 and abortOnFail is true
It would look like this
return generator.runActions(answers, {onSuccess, onFailure, onComment})
.then((generator) => {
progress.stop();
if (generator.failures.length > 1 && generator.abortOnFail) {
process.exit(1);
}
});
Why do you think?
Thank you for your work by the way :)