jashkenas/coffee-script — Issue #1939: -cw causes multiple compiles on one file upload
Author: mark-hahn
Created: 2011-12-16 07:25:23+00:00
State: open

I have a -cw watch on a directory. When I push an update to the file over the net with scp I will get something like this from one update to a clean file ...

23:14:26 - compiled /ria/src/views/pages/view_client.cof
23:14:26 - compiled /ria/src/views/pages/view_client.cof
In /ria/src/views/pages/view_client.cof, Parse error on line 700: Unexpected 'POST_IF'
23:14:27 - compiled /ria/src/views/pages/view_client.cof
23:14:28 - compiled /ria/src/views/pages/view_client.cof

Apparently it takes about two seconds to upload the file and also apparently scp just writes over the file in-place. Coffee is compiling the file over and over and seeing the file in an inconsistent state.

What causes this and can it be fixed?