I’m looking for simplest possible way to automatically recompile coffee scripts into JS.
Reading documentation but still having troubles to get exactly what I want.
I need it to watch folder src/ for any *.coffee files modifications and compile them into concatenated javascript file into lib/something.js.
Somehow can’t combine watching, compiling and concatenating together. :/
The coffee script documentation provides an example for this:
Watch a file for changes, and recompile it every time the file is saved:
If you have a particular script you want to execute, you could use the linux command dnotify:
http://linux.die.net/man/1/dnotify
Edit:
I had some problems with the –execute part of dnotify – might be a bug, but this is what I got working:
That executed the compile command each time a file was modified.
If you append the command with an ampersand, like this:
it will be started in a separate process. To get the process ID, you can use this:
And then, you can kill the process by using something like this:
But if that’s your objective (to kill by process name), you can do it in a simpler way by using: