Permalink
Browse files

Kill the PHP process when grunt is done

  • Loading branch information...
1 parent 815fd26 commit 5d8c13d63b00e16391e97f26fefd618f983b6edb @sindresorhus committed Apr 6, 2013
Showing with 7 additions and 2 deletions.
  1. +1 −1 package.json
  2. +6 −1 tasks/php.js
View
@@ -25,7 +25,7 @@
"open": "0.0.3"
},
"devDependencies": {
- "grunt": "~0.4.0",
+ "grunt": "~0.4.1",
"grunt-simple-mocha": "~0.3.2",
"request": "~2.14.0"
},
View
@@ -35,11 +35,16 @@ module.exports = function (grunt) {
args.push(options.router);
}
- spawn('php', args, {
+ var cp = spawn('php', args, {
cwd: path.resolve(options.base),
stdio: 'inherit'
});
+ // quit PHP when grunt is done
+ process.on('exit', function () {
+ cp.kill();
+ });
+
// check when the server is ready. tried doing it by listening
// to the child process `data` event, but it's not triggered...
checkServer('http://' + host, function () {

0 comments on commit 5d8c13d

Please sign in to comment.