Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Kill the PHP process when grunt is done

  • Loading branch information...
commit 5d8c13d63b00e16391e97f26fefd618f983b6edb 1 parent 815fd26
Sindre Sorhus authored

Showing 2 changed files with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. +1 1  package.json
  2. +6 1 tasks/php.js
2  package.json
@@ -25,7 +25,7 @@
25 25 "open": "0.0.3"
26 26 },
27 27 "devDependencies": {
28   - "grunt": "~0.4.0",
  28 + "grunt": "~0.4.1",
29 29 "grunt-simple-mocha": "~0.3.2",
30 30 "request": "~2.14.0"
31 31 },
7 tasks/php.js
@@ -35,11 +35,16 @@ module.exports = function (grunt) {
35 35 args.push(options.router);
36 36 }
37 37
38   - spawn('php', args, {
  38 + var cp = spawn('php', args, {
39 39 cwd: path.resolve(options.base),
40 40 stdio: 'inherit'
41 41 });
42 42
  43 + // quit PHP when grunt is done
  44 + process.on('exit', function () {
  45 + cp.kill();
  46 + });
  47 +
43 48 // check when the server is ready. tried doing it by listening
44 49 // to the child process `data` event, but it's not triggered...
45 50 checkServer('http://' + host, function () {

0 comments on commit 5d8c13d

Please sign in to comment.
Something went wrong with that request. Please try again.