Exit code is not properly set when template compilation failed
- Maizzle Version: 4.8.4
- Node.js Version: 18.19.0
Hello,
I find that the exit code will be set to zero even if there is an compilation failure across templates:
Log:
$ maizzle build production
✖ Failed to compile template: promotional.html
⚠ [components] <x-notExist> could not find notExist.html in the defined root paths (src/components, src/layouts, src/templates)
✔ Built 0 templates in 0.16s
✨ Done in 0.74s.
When I echo the exit code, it is zero.
I followed the #986, however the error code is always zero regardless of which config.build.fail I choose (verbose, silent or unset). I would like Maizzle to fail so the CI can detect it.
Thanks so much for the help!
Right, so the problem is here:
https://github.com/maizzle/framework/blob/659e2a47ed2584153fd4fbc93d176387bac885ad/src/generators/output/to-disk.js#L239
We should just throw in that case, i.e.:
- .catch(error => spinner.warn(error.message))
+ .catch(error => {
+ throw error
+ })
I'll try to release a fix this week, thanks for bringing it up 👍
Thank you so much Cosmin, appreciate the help!