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?
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.
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:appears to kill the watch task also. Maybe I'm misusing
process.exit()
? any pointers for adding this sort of functionality?