-
-
Notifications
You must be signed in to change notification settings - Fork 279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: templ generate exits with 0 when there are errors #513
Comments
Thanks for the report. However, since the release you're using, that code has been completely rewritten from scratch, so the If you'd like to try the same operation with the latest CLI, by installing from source, e.g. |
Hi, here's the result when using 8a1cd80:
It definitely exits with a non zero code! |
Ha, yes, very much a fail. It looks like the errors channel is being closed too early (only in the case that the I'm able to reproduce it:
|
I've taken a look at this area and made a few improvements. For example, I noticed that the logging showed you errors, but didn't show you if the error was cleared (by editing the file). So even though there weren't any more errors, the terminal output didn't show you that. If you could give e78dbc1 a try out, that would be excellent. |
Looks like it is working now! I'm not familiar with the codebase, but do you think it would warrant a test for that behavior? (exit != 0 on error?) |
Yeah, it would be worth a test. There's only a test on the happy path (successful generation) at the moment. |
This is very similar to #278, when running
templ generate
on an invalid template, the command exits with 0:Given the following templ file:
Running generate yields this:
There seem to be an issue in the
generateProduction
method, where the errors are seen and counted, but not returned:The text was updated successfully, but these errors were encountered: