Fixing postcss not exiting with the proper exit code in --watch#178
Fixing postcss not exiting with the proper exit code in --watch#178RyanZim merged 2 commits intopostcss:developfrom
Conversation
…d during the first pass with --watch
|
|
|
Except for this |
|
In case you got a |
|
Yep exactly, that's intended |
|
The CLI should recover from |
|
A better solution would be to resolve with the list of files and not exit, but this is an easier change, for now. |
|
Duh, yeah forgot about that line. That's totally intended; not changing this. |
|
Can you explain why? This is an issue for me. I have a script that is running babel and postcss, both in watch mode, and I need to know if postcss exits with an error. |
|
As mentioned, your solution would by a undesired breaking change since it breaks watch mode on |
|
My change doesn't break watch mode, as I'm only calling Also, babel isn't handling file I/O, it just happens to be running at the same time as postcss. With my change postcss does not exit if you accidentally make a typo. |
|
Ah, sorry, misunderstood your change. Yeah, for the first pass, that's debatable. Reopening for discussion. |
michael-ciniawsky
left a comment
There was a problem hiding this comment.
Yep, that's a bug the process should immediately exit with the correct process.exitCode = 1 in this case (first pass) imho
| }) | ||
| .catch(error) | ||
| .catch(err => { | ||
| error(err) |
RyanZim
left a comment
There was a problem hiding this comment.
This is semver-major, will be a bit till I release it.
|
Merged into |
|
Released in v5, sorry for the long wait here. |
When running
postcss --watch, if an error is encountered during the first pass postcss currently exits with an exit code of 0. The reason this is happening is because the error function specifically doesn't callprocess.exit(1)in watch mode.