cri5ti/grunt-shell-spawn — pull request #22 by jansegre (2014-04-22 05:21:58+00:00)
Title: Adding support for stopping process if already started.

My use case is this:

- There is an http server that depend on several sources;
- The sources are watched with grunt-contrib-watch;
- I want to restart the server if any source changes;
- I want to avoid killing the server with SIGKILL so it can exit properly.

What I did:

- Allow a shell sub task to be called more than one time, if a process exists it will be killed (with SIGTERM);
- Add an option to enable that, defaulting to the old (and expected) behaviour.

I changed the minor version, but in retrospection I should have changed the middle one since it's a feature.

I didn't take the time to write a test, sorry.

If there is a better way to do that I'd love to hear.