jakejs / jake

JavaScript build tool, similar to Make or Rake. Built to work with Node.js.
http://jakejs.com
Apache License 2.0
1.97k stars 190 forks source link

Possible to kill a specific process with process.exit()? #235

Open dadambickford opened 10 years ago

dadambickford commented 10 years ago

I would like to be able to watch for changes to server side files, kill the server and restart it. I found process.exit() in the docs but trying something like this:

watch(['server/'], function () {
    process.exit();
    jake.exec('server start');
  });

appears to kill the watch task also. Maybe I'm misusing process.exit()? any pointers for adding this sort of functionality?

mde commented 10 years ago

Sounds like you want to start the server with a child process, and kill that. If you kill the process Jake is running in, then of course Jake will stop executing.