Open pmarrapese opened 4 years ago
I can see where this would be an inconvenience — I'm curious though, why are you not simply using the native execSync
everywhere? All the Exec
code in Jake pre-dated the existing of a synchronous exec
, and was only there to make shelling out asynchronously a little less painful.
In this case, Leaflet.markercluster was still using the jake.exec
method and throwing a very confusing error message because I didn't have jshint
installed. Only took a few moments to figure out what was going on, so figured I'd share the knowledge. :)
Presently, if Jake fails due to a child process failing, the exception is very confusing. This is especially the case on Windows, where the "command not found" message takes up 2 lines.
This pull request changes how
Exec
handles errors by using a properError
object instead of merely concatenating the output ofstderr
. As a result,api.fail
will not attempt to build theError
object from scratch and potentially mutilate the child process's error message.Example (without patch):
Example (with patch):
Now, it is much more clear why the child process failed.