If a task in grunt fails in between selenium_standalone:target:start and selenium_standalone:target:stop, causing grunt to exit before the stop call, the selenium_standalone server process was never being stopped. This PR adds a flag to handle process.on('exit' to make sure a running task is stopped. Also placed a conditional around the stop to make sure the kill function wasn't called if it didn't exist.
If a task in grunt fails in between selenium_standalone:target:start and selenium_standalone:target:stop, causing grunt to exit before the stop call, the selenium_standalone server process was never being stopped. This PR adds a flag to handle process.on('exit' to make sure a running task is stopped. Also placed a conditional around the stop to make sure the kill function wasn't called if it didn't exist.